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 Details

    • 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 Details

    • 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 Details

    • 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.
    • run

      public void run()
      INTERNAL: This is the execution method of the async propagation thread. It will create other threads, one each for the remote connections, to propagate the command.
      Specified by:
      run in interface Runnable