Top Description Methods
org.eclipse.persistence.sessions.coordination

public Interface CommandManager

Known Direct Implementers
org.eclipse.persistence.sessions.coordination.RemoteCommandManager

Purpose: Provide an interface that clients can use to invoke remote commands on other EclipseLink instances, or on other applications that may want to receive and process EclipseLink commands.

Description: This is the main interface that is used to send and receive remote commands in a EclipseLink cluster. The sequence of remote command execution is as follows:

  1. CommandProcessor creates a command and gives it to its local CommandManager to send to remote services.
  2. CommandManager uses its CommandConverter to convert the command into a TopLink Command object
  3. CommandManager then uses its TransportManager to send the Command to all other known cluster members that are subscribing to the same channel
  4. Each remote TransportManager receives the Command and passes it off to the CommandManager
  5. Each CommandManager uses its local CommandConverter to convert the command into a format appropriate to its application (CommandProcessor)
  6. Each CommandManager invokes its local CommandProcessor and passes it the command (formatted the way that the application-specified converter left it in) to be executed. If the CommandProcessor is a EclipseLink session then the executeWithSession method will be invoked on the command.

Responsibilities:

Author
Steven Vo
Since
OracleAS TopLink 10g (9.0.4)
See Also
Command, CommandProcessor

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The service channel String subscribed to by this CommandManager
getChannel
()

PUBLIC: Return the service channel for this command manager.

public CommandConverter

Returns:

The converter being used by this CommandManager
getCommandConverter
()

PUBLIC: Return the converter instance used to convert between TopLink Command objects and an application command format.

public CommandProcessor

Returns:

An implementation instance of CommandProcessor
getCommandProcessor
()

PUBLIC: Return the command processor that processes commands received from the cluster.

public DiscoveryManager

Returns:

The DiscoveryManager instance being used by this CommandManager
getDiscoveryManager
()

PUBLIC: Return the discovery manager that manages membership in the EclipseLink cluster.

public TransportManager

Returns:

The TransportManager instance being used by this CommandManager
getTransportManager
()

PUBLIC: Return the transport manager that manages sending and receiving of remote commands.

public String

Returns:

The URL String for this CommandManager
getUrl
()

PUBLIC: Return the URL for this command manager.

public void
initialize()

PUBLIC: Initialize the remote command manager.

public boolean
isCommandProcessorASession()

ADVANCE: Return whether this commandProcessor is a EclipseLink session or not.

public void
propagateCommand(Object
An object representing a TopLink command
command
)

ADVANCED: Propagate a remote command to all remote RCM services participating in the EclipseLink cluster.

public void
setChannel(String
The service channel subscribed to by this CommandManager
channel
)

ADVANCED: Set the service channel for this command manager.

public void
setCommandConverter(CommandConverter
The converter to be used by this CommandManager
commandConverter
)

ADVANCED: Set the converter instance that will be invoked by this CommandProcessor to convert commands from their application command format into EclipseLink Command objects before being propagated to remote command manager services.

public void
setCommandProcessor(CommandProcessor
The intended processor of remote commands
commandProcessor
)

ADVANCED: Set the command processor that will be invoked to process commands.

public void
setShouldPropagateAsynchronously(boolean asyncMode)

ADVANCED: Set whether this command manager should propagate commands synchronously or asynchronously.

public void
setTransportManager(TransportManager
An instance of the desired transport manager type
newTransportManager
)

ADVANCED: Set a specific transport manager to manage sending and receiving of remote commands.

public void
setUrl(String
The URL String for this CommandManager
url
)

ADVANCED: Set the URL for this command manager.

public boolean
shouldPropagateAsynchronously()

PUBLIC: Return whether this command manager should propagate commands synchronously or asynchronously.

public void
shutdown()

PUBLIC: Shut down the remote command manager.

Method Detail

getChannelback to summary
public String getChannel()

PUBLIC: Return the service channel for this command manager. All command managers with the same service channel will send and receive commands from each other. Commands sent on other service channels will not be exchanged with this command manager.

Returns:String

The service channel String subscribed to by this CommandManager

getCommandConverterback to summary
public CommandConverter getCommandConverter()

PUBLIC: Return the converter instance used to convert between TopLink Command objects and an application command format.

Returns:CommandConverter

The converter being used by this CommandManager

getCommandProcessorback to summary
public CommandProcessor getCommandProcessor()

PUBLIC: Return the command processor that processes commands received from the cluster.

Returns:CommandProcessor

An implementation instance of CommandProcessor

getDiscoveryManagerback to summary
public DiscoveryManager getDiscoveryManager()

PUBLIC: Return the discovery manager that manages membership in the EclipseLink cluster.

Returns:DiscoveryManager

The DiscoveryManager instance being used by this CommandManager

getTransportManagerback to summary
public TransportManager getTransportManager()

PUBLIC: Return the transport manager that manages sending and receiving of remote commands.

Returns:TransportManager

The TransportManager instance being used by this CommandManager

getUrlback to summary
public String getUrl()

PUBLIC: Return the URL for this command manager.

Returns:String

The URL String for this CommandManager

initializeback to summary
public void initialize()

PUBLIC: Initialize the remote command manager. This will also trigger the DiscoveryManager to start establishing the EclipseLink cluster.

isCommandProcessorASessionback to summary
public boolean isCommandProcessorASession()

ADVANCE: Return whether this commandProcessor is a EclipseLink session or not.

propagateCommandback to summary
public void propagateCommand(Object command)

ADVANCED: Propagate a remote command to all remote RCM services participating in the EclipseLink cluster.

Parameters
command:Object

An object representing a TopLink command

setChannelback to summary
public void setChannel(String channel)

ADVANCED: Set the service channel for this command manager. All command managers with the same service channel will send and receive commands from each other. Commands sent on other service channels will not be exchanged with this command manager.

Parameters
channel:String

The service channel subscribed to by this CommandManager

setCommandConverterback to summary
public void setCommandConverter(CommandConverter commandConverter)

ADVANCED: Set the converter instance that will be invoked by this CommandProcessor to convert commands from their application command format into EclipseLink Command objects before being propagated to remote command manager services. The converter will also be invoked to convert EclipseLink Command objects into application format before being sent to the CommandProcessor for execution.

Parameters
commandConverter:CommandConverter

The converter to be used by this CommandManager

setCommandProcessorback to summary
public void setCommandProcessor(CommandProcessor commandProcessor)

ADVANCED: Set the command processor that will be invoked to process commands. EclipseLink applications can implement this interface in order to receive remote commands from a EclipseLink cluster.

Parameters
commandProcessor:CommandProcessor

The intended processor of remote commands

setShouldPropagateAsynchronouslyback to summary
public void setShouldPropagateAsynchronously(boolean asyncMode)

ADVANCED: Set whether this command manager should propagate commands synchronously or asynchronously. If set to synchronous propagation then propagateCommand() will not return to the caller until the command has been executed on all of the services in the cluster. In asynchronous mode the command manager will create a separate thread for each of the remote service executions, and then promptly return to the caller.

setTransportManagerback to summary
public void setTransportManager(TransportManager newTransportManager)

ADVANCED: Set a specific transport manager to manage sending and receiving of remote commands.

Parameters
newTransportManager:TransportManager

An instance of the desired transport manager type

setUrlback to summary
public void setUrl(String url)

ADVANCED: Set the URL for this command manager.

Parameters
url:String

The URL String for this CommandManager

shouldPropagateAsynchronouslyback to summary
public boolean shouldPropagateAsynchronously()

PUBLIC: Return whether this command manager should propagate commands synchronously or asynchronously. If set to synchronous propagation then propagateCommand() will not return to the caller until the command has been executed on all of the services in the cluster. In asynchronous mode the command manager will create a separate thread for each of the remote service executions, and then promptly return to the caller.

shutdownback to summary
public void shutdown()

PUBLIC: Shut down the remote command manager. This will also trigger the DiscoveryManager to stop.

Note

Although this call initiates the shutdown process, no guarantees are made as to when it will actually complete.