|
EclipseLink 1.1.0_ 1.1.0.r3634 API Reference | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.persistence.sessions.coordination.RemoteCommandManager
public class RemoteCommandManager
Purpose: Provide a CommandManager implementation that will be used by both TopLink and non-TopLink applications.
Description: A RemoteCommandManager (or RCM) instance is the primary component of an RCM service instance. It manages the other components of the service, and directs the overall service operation. Its ServiceId uniquely distinguishes it from other service instances in the cluster.
Each RCM has a logical channel to which it subscribes and publishes. This channel determines which other instances in the cluster the service instance sends and receives remote commands to/from. All RCM's on the same channel should have the same discovery manager settings (be communicating on the same multicast) so that the discovery managers may be able to discover one another. RCM's on different channels may operate on the same or on different multicast groups.
An RCM instance knows about other instances in the cluster through its DiscoveryManager. Its TransportManager is repsonsible for setting up the connections to other instances once they are discovered.
An RCM is instructed to "propagate", or execute on all remote service instances in the cluster that subscribe to the same channel, a remote command by its CommandProcessor. Likewise, when an RCM receives a remote command to be executed then it passes the command off to the CommandProcessor for the processing of the command to occur. CommandProcessors pass commands to the RCM as an Object (in a format that may be specific to the application) and the RCM uses its CommandConverter to convert it to a TopLink Command object before sending the Command off to the cluster. Similarly, when a TopLink Command object is received then the RCM invokes its CommandConverter to convert the object into the application format that will be passed to the CommandProcessor to process the command.
CommandManager,
Command,
CommandProcessor,
CommandConverter,
CommandTransporter,
DiscoveryManager| Field Summary | |
|---|---|
protected CommandConverter |
commandConverter
Used for converting commands between TopLink Command and app command formats |
protected CommandProcessor |
commandProcessor
Invoked to process a command when it is received from the cluster |
static boolean |
DEFAULT_ASYNCHRONOUS_MODE
|
static java.lang.String |
DEFAULT_CHANNEL
|
protected DiscoveryManager |
discoveryManager
Manages the detection of new services as they join the cluster |
protected boolean |
isAsynchronous
Determines whether propagation should be synchronous or asynchronous |
protected boolean |
isStopped
|
protected boolean |
isTopLinkSession
Determines whether profiling command should be send |
protected ServerPlatform |
serverPlatform
Uniquely identifies ServerPlatform in the cluster |
protected ServiceId |
serviceId
Uniquely identifies this service in the cluster |
protected TransportManager |
transportManager
Manages the transport level connections between command managers |
| Constructor Summary | |
|---|---|
RemoteCommandManager(CommandProcessor commandProcessor)
|
|
RemoteCommandManager(CommandProcessor commandProcessor,
TransportManager transportManager)
|
|
| Method Summary | |
|---|---|
java.lang.String |
getChannel()
PUBLIC: Return the service channel for this command manager. |
CommandConverter |
getCommandConverter()
PUBLIC: Return the converter instance used to convert between TopLink Command objects and an application command format. |
CommandProcessor |
getCommandProcessor()
PUBLIC: Return the command processor that processes commands received from the cluster. |
DiscoveryManager |
getDiscoveryManager()
PUBLIC: Return the discovery manager that detects the arrival of new cluster members |
ServerPlatform |
getServerPlatform()
INTERNAL: Return the serverPlatform that identifies the application server |
ServiceId |
getServiceId()
INTERNAL: Return the service info that identifies this service instance |
TransportManager |
getTransportManager()
PUBLIC: Return the transport manager that manages sending and receiving of remote commands. |
java.lang.String |
getUrl()
PUBLIC: Return the URL for this command manager. |
void |
handleException(java.lang.RuntimeException exception)
INTERNAL: Delegate to the command procesor to handle the exception. |
void |
initialize()
PUBLIC: Initialize the remote command manager. |
boolean |
isCommandProcessorASession()
INTERNAL: Return whether this command manager should process profile commands |
boolean |
isStopped()
PUBLIC: Indicates whether the RCM has been stopped: either initialize hasn't been called or shutdown has been called. |
void |
logDebug(java.lang.String message,
java.lang.Object[] args)
INTERNAL: Convenience logging methods. |
void |
logDebugWithoutLevelCheck(java.lang.String message,
java.lang.Object[] args)
|
void |
logError(java.lang.String message,
java.lang.Object[] args)
|
void |
logInfo(java.lang.String message,
java.lang.Object[] args)
|
void |
logMessage(int logLevel,
java.lang.String message,
java.lang.Object[] args)
INTERNAL: |
void |
logMessageWithoutLevelCheck(int logLevel,
java.lang.String message,
java.lang.Object[] args)
INTERNAL: Use this method in case the necessary logLevel has been confirmed by calling commandProcessor.shouldLogMessages method |
void |
logWarning(java.lang.String message,
java.lang.Object[] args)
|
void |
logWarningWithoutLevelCheck(java.lang.String message,
java.lang.Object[] args)
|
void |
newServiceDiscovered(ServiceId service)
INTERNAL: A new service has been detected by the discovery manager. |
void |
processCommandFromRemoteConnection(Command command)
INTERNAL: Delegate to command processor |
void |
propagateCommand(java.lang.Object command)
ADVANCED: Propagate a remote command to all remote RCM services participating in the TopLink cluster. |
void |
replaceLocalHostIPAddress(java.lang.String ipAddress)
ADVANCED: Allow user to replace the $HOST subString of the local host URL with the user user input at runtime. |
void |
replaceTransportPortNumber(java.lang.String portNumber)
ADVANCED: Allow user to replace the $PORT subString of the local host URL with the user user input at runtime. |
void |
setChannel(java.lang.String channel)
ADVANCED: Set the service channel for this command manager. |
void |
setCommandConverter(CommandConverter newCommandConverter)
ADVANCED: Set the converter instance that will be invoked by this CommandProcessor to convert commands from their application command format into TopLink Command objects before being propagated to remote command manager services. |
void |
setCommandProcessor(CommandProcessor newCommandProcessor)
ADVANCED: Set the command processor that will be invoked to process commands. |
void |
setServerPlatform(ServerPlatform theServerPlatform)
PUBLIC: The ServerPlatform must be set manually when the RemoteCommandManager'CommandProcessor is not TopLink Session. |
void |
setShouldPropagateAsynchronously(boolean asyncMode)
ADVANCED: Set whether this command manager should propagate commands synchronously or asynchronously. |
void |
setTransportManager(TransportManager newTransportManager)
ADVANCED: Set a specific transport manager to manage sending and receiving of remote commands. |
void |
setUrl(java.lang.String url)
ADVANCED: Set the URL for this command manager. |
boolean |
shouldLogDebugMessage()
|
boolean |
shouldLogMessage(int logLevel)
INTERNAL: |
boolean |
shouldLogWarningMessage()
|
boolean |
shouldPropagateAsynchronously()
PUBLIC: Return whether this command manager should propagate commands synchronously or asynchronously. |
void |
shutdown()
PUBLIC: Shut down the remote command manager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_CHANNEL
public static final boolean DEFAULT_ASYNCHRONOUS_MODE
protected ServiceId serviceId
protected DiscoveryManager discoveryManager
protected TransportManager transportManager
protected CommandProcessor commandProcessor
protected CommandConverter commandConverter
protected boolean isAsynchronous
protected boolean isTopLinkSession
protected ServerPlatform serverPlatform
protected boolean isStopped
| Constructor Detail |
|---|
public RemoteCommandManager(CommandProcessor commandProcessor)
public RemoteCommandManager(CommandProcessor commandProcessor,
TransportManager transportManager)
| Method Detail |
|---|
public void initialize()
initialize in interface CommandManagerpublic boolean isStopped()
public void shutdown()
shutdown in interface CommandManagerpublic void propagateCommand(java.lang.Object command)
propagateCommand in interface CommandManagercommand - An object representing a TopLink commandpublic void processCommandFromRemoteConnection(Command command)
public CommandProcessor getCommandProcessor()
CommandManager
getCommandProcessor in interface CommandManagerpublic void setCommandProcessor(CommandProcessor newCommandProcessor)
CommandManager
setCommandProcessor in interface CommandManagernewCommandProcessor - The intended processor of remote commandspublic TransportManager getTransportManager()
CommandManager
getTransportManager in interface CommandManagerpublic void setTransportManager(TransportManager newTransportManager)
CommandManager
setTransportManager in interface CommandManagernewTransportManager - An instance of the desired transport manager typepublic void handleException(java.lang.RuntimeException exception)
public void newServiceDiscovered(ServiceId service)
public DiscoveryManager getDiscoveryManager()
getDiscoveryManager in interface CommandManagerpublic CommandConverter getCommandConverter()
getCommandConverter in interface CommandManagerpublic void setCommandConverter(CommandConverter newCommandConverter)
setCommandConverter in interface CommandManagernewCommandConverter - The converter to be used by this CommandManagerpublic boolean shouldLogMessage(int logLevel)
public boolean shouldLogDebugMessage()
public boolean shouldLogWarningMessage()
public void logMessage(int logLevel,
java.lang.String message,
java.lang.Object[] args)
public void logMessageWithoutLevelCheck(int logLevel,
java.lang.String message,
java.lang.Object[] args)
public void logDebug(java.lang.String message,
java.lang.Object[] args)
public void logDebugWithoutLevelCheck(java.lang.String message,
java.lang.Object[] args)
public void logInfo(java.lang.String message,
java.lang.Object[] args)
public void logWarning(java.lang.String message,
java.lang.Object[] args)
public void logWarningWithoutLevelCheck(java.lang.String message,
java.lang.Object[] args)
public void logError(java.lang.String message,
java.lang.Object[] args)
public ServiceId getServiceId()
public java.lang.String getChannel()
getChannel in interface CommandManagerpublic void setChannel(java.lang.String channel)
setChannel in interface CommandManagerchannel - The service channel subscribed to by this CommandManagerpublic boolean isCommandProcessorASession()
isCommandProcessorASession in interface CommandManagerpublic java.lang.String getUrl()
getUrl in interface CommandManagerpublic void setUrl(java.lang.String url)
setUrl in interface CommandManagerurl - The URL String for this CommandManagerpublic boolean shouldPropagateAsynchronously()
shouldPropagateAsynchronously in interface CommandManagerpublic void setShouldPropagateAsynchronously(boolean asyncMode)
setShouldPropagateAsynchronously in interface CommandManagerpublic void replaceLocalHostIPAddress(java.lang.String ipAddress)
public void replaceTransportPortNumber(java.lang.String portNumber)
public ServerPlatform getServerPlatform()
public void setServerPlatform(ServerPlatform theServerPlatform)
|
EclipseLink 1.1.0_ 1.1.0.r3634 API Reference | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||