Module org.eclipse.persistence.core
Class CommandPropagator
- java.lang.Object
-
- org.eclipse.persistence.internal.sessions.coordination.CommandPropagator
-
- All Implemented Interfaces:
Runnable
public class CommandPropagator extends Object implements Runnable
Purpose: Synchronous and asynchronous propagation of remote commands
Description: Maintains a reference to the RemoteCommandManager to obtain the connection information required to send the commands. In sync mode the caller is blocked until the command has been sent along all of the connections. If in async mode then a CommandPropagator instance is further created for each of the connections and control is returned to the caller while the threads send the command to the remote services.
-
-
Field Summary
Fields Modifier and Type Field Description protected CommandcommandThe command to sendprotected byte[]commandBytesThe command to sendprotected RemoteConnectionconnectionConnection to send toprotected RemoteCommandManagerrcmReference to manager to get connections, etc.
-
Constructor Summary
Constructors Constructor Description CommandPropagator(RemoteCommandManager rcm, Command command, byte[] commandBytes)Constructor used to create the main propagatorCommandPropagator(RemoteCommandManager rcm, Command command, byte[] commandBytes, RemoteConnection connection)Constructor used to create the async propagator threads
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidasynchronousPropagateCommand()INTERNAL: Asynchronously propagate the commandprotected CommandgetCommand()INTERNAL: Returns the command to be sentprotected RemoteCommandManagergetRemoteCommandManager()INTERNAL: Returns the remote command managervoidhandleCommunicationException(RemoteConnection conn, CommunicationException comEx)INTERNAL: We received the specified CommunicationException trying to execute the command over the specified connection.voidhandleExceptionFromRemoteExecution(RemoteConnection conn, String exString)INTERNAL: We received the specified exception String while executing the command over the specified connection.voidpropagateCommand(RemoteConnection connection)INTERNAL: Propagate the command to the specified connection.voidrun()INTERNAL: This is the execution method of the async propagation thread.voidsynchronousPropagateCommand()INTERNAL: Synchronously propagate the command
-
-
-
Field Detail
-
rcm
protected RemoteCommandManager rcm
Reference to manager to get connections, etc.
-
command
protected Command command
The command to send
-
commandBytes
protected byte[] commandBytes
The command to send
-
connection
protected RemoteConnection connection
Connection to send to
-
-
Constructor Detail
-
CommandPropagator
public CommandPropagator(RemoteCommandManager rcm, Command command, byte[] commandBytes)
Constructor used to create the main propagator
-
CommandPropagator
public CommandPropagator(RemoteCommandManager rcm, Command command, byte[] commandBytes, RemoteConnection connection)
Constructor used to create the async propagator threads
-
-
Method Detail
-
getRemoteCommandManager
protected RemoteCommandManager getRemoteCommandManager()
INTERNAL: Returns the remote command manager
-
getCommand
protected Command getCommand()
INTERNAL: Returns the command to be sent
-
synchronousPropagateCommand
public void synchronousPropagateCommand()
INTERNAL: Synchronously propagate the command
-
asynchronousPropagateCommand
public void asynchronousPropagateCommand()
INTERNAL: Asynchronously propagate the command
-
propagateCommand
public void propagateCommand(RemoteConnection connection)
INTERNAL: Propagate the command to the specified connection.
-
handleExceptionFromRemoteExecution
public void handleExceptionFromRemoteExecution(RemoteConnection conn, String exString)
INTERNAL: We received the specified exception String while executing the command over the specified connection. Turn it into a RemoteCommandManagerException and throw it on this, the client side.
-
handleCommunicationException
public void handleCommunicationException(RemoteConnection conn, CommunicationException comEx)
INTERNAL: We received the specified CommunicationException trying to execute the command over the specified connection. We treat CommunicationExceptions as the transport-generic wrapper exception that wraps the transport exception, so the real exception that interests us is inside.
-
-