public interface CommandProcessor
Purpose: Defines a pluggable interface for EclipseLink sessions and EclipseLink applications to be able to be on the receiving end of EclipseLink command objects.
Description: This interface represents the entity that both initiates (on the sending end) and processes (on the receiving end) remote commands. The implementation classes of this interface should be set on the CommandManager so that it can be invoked to process command messages as they get received from other remote command managers in the TopLink cluster. When the implementing class wants to send a remote command to other CommandProcessors then it invokes the CommandManager to do so. When running this remote command service in a EclipseLink application then the the Session class should be used as the implementation class for this interface. When running in a non-TopLink application then the application should provide the implementation class.
Command
,
CommandManager
Modifier and Type | Field and Description |
---|---|
static int |
LOG_DEBUG |
static int |
LOG_ERROR |
static int |
LOG_INFO |
static int |
LOG_WARNING |
Modifier and Type | Method and Description |
---|---|
void |
endOperationProfile(java.lang.String operationName)
Profile the operation.
|
CommandManager |
getCommandManager()
PUBLIC:
Return the CommandManager that will invoke this CommandProcessor to process
a command, and can be used to send remote commands out to other
CommandProcessors in the cluster.
|
java.lang.Object |
handleException(java.lang.RuntimeException exception)
PUBLIC:
Allow the implementation class to handle an exception thrown in in the remote
command service.
|
void |
incrementProfile(java.lang.String counter)
Log the profile event.
|
void |
logMessage(int logLevel,
java.lang.String message)
PUBLIC:
Log a message to the application log output stream.
|
void |
processCommand(java.lang.Object command)
PUBLIC:
Invoked by the CommandManager after it has received a Command object and
has converted it to the application command format.
|
void |
setCommandManager(CommandManager commandManager)
PUBLIC:
Set the CommandManager that will invoke this CommandProcessor to process
a command, and can be used to send remote commands out to other
CommandProcessors in the cluster.
|
boolean |
shouldLogMessages(int logLevel)
PUBLIC:
Determine whether messages at the specified log level should be logged.
|
void |
startOperationProfile(java.lang.String operationName)
Profile the operation.
|
void |
updateProfile(java.lang.String info,
java.lang.Object value)
Log the profile event.
|
static final int LOG_DEBUG
static final int LOG_INFO
static final int LOG_WARNING
static final int LOG_ERROR
void processCommand(java.lang.Object command)
command
- Application formatted command to be processedCommandManager getCommandManager()
void setCommandManager(CommandManager commandManager)
commandManager
- The remote command manager responsible for this CommandProcessorboolean shouldLogMessages(int logLevel)
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUGvoid logMessage(int logLevel, java.lang.String message)
logLevel
- A log constant that is one of LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUGmessage
- The message String that is to be loggedvoid incrementProfile(java.lang.String counter)
void updateProfile(java.lang.String info, java.lang.Object value)
void startOperationProfile(java.lang.String operationName)
void endOperationProfile(java.lang.String operationName)
java.lang.Object handleException(java.lang.RuntimeException exception)
exception
- The exception being thrown