|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grid.jgrid.server.JCEPProtocolModule
This class defines the interface for classes which which to implement a JCEP service. JCEP stands for JGrid Compute Engine Protocol. It is a simple protocol which allows a client and server to send commands and job information over a socket connection.
Field Summary | |
private static byte |
CURRENT_VERSION
The lastest version of the JCEP protocol. |
private static java.util.logging.Logger |
log
The logging mechanism |
private static byte |
MIN_VERSION
The minimum version of the JCEP protocol supported by the protocol module factory. |
protected static java.util.List |
moduleList
The list of JCEPProtocolModules with open client connections. |
static java.lang.String |
SYSTEM_ID
Used with logMessage() and logError() to indicated that the message comes from the JCEPProtocolModule, not from a Job. |
Fields inherited from interface com.sun.grid.jgrid.server.JCEP |
CANCEL_JOB, CHECKPOINT_JOB, COMMAND_FAILED, HANDSHAKE, JOB_CHECKPOINTED, JOB_STATE_CHANGE, LOG_ERROR, LOG_MESSAGE, PORT, REGISTER, RESUME, SHUTDOWN, SHUTTING_DOWN, STATE_COMPLETED, STATE_FAILED, STATE_RUNNING, STATE_STOPPED, STATE_SUSPENDED, SUBMIT_JOB, SUSPEND, UNREGISTER, VERSION10 |
Constructor Summary | |
JCEPProtocolModule()
|
Method Summary | |
(package private) abstract void |
closeConnection()
This method shuts down the protocol module. |
private static byte |
doHandshake(java.io.DataInputStream din,
java.io.DataOutputStream dout)
This method confirms that the client is attempting to establish a JCEP communication channel and establishes the version of JCEP to use. |
(package private) static JCEPProtocolModule |
establishConnection(JCEPListener engine,
java.net.Socket socket)
Establishes a connection to the client over the given socket and sets the handler for the connection. |
(package private) abstract void |
logError(java.lang.String jobId,
java.lang.String error)
Tells the protocol module to notify its client of an error from an executing job. |
(package private) abstract void |
logMessage(java.lang.String jobId,
java.lang.String message)
Tells the protocol module to notify its client of a message from an executing job. |
protected static void |
notifyAllModules()
This method is used to propogate a shutdown notice to all open protocol modules. |
(package private) abstract void |
notifyJobCheckpointed(java.lang.String jobId)
Tells the protocol module to notify its client that a job has been checkpointed. |
(package private) abstract void |
notifyJobCompleted(java.lang.String jobId)
Tells the protocol module to notify its client that a job has completed execution normally. |
(package private) abstract void |
notifyJobFailed(java.lang.String jobId)
Tells the protocol module to notify its client that a job has terminated execution abnormally because of an error during execution. |
(package private) abstract void |
notifyJobResumed(java.lang.String jobId)
Tells the protocol module to notify its client that a job has been resumed. |
(package private) abstract void |
notifyJobStarted(java.lang.String jobId)
Tells the protocol module to notify its client that a job has started execution. |
(package private) abstract void |
notifyJobStopped(java.lang.String jobId)
Tells the protocol module to notify its client that a job has terminated execution abnormally by being canceled. |
(package private) abstract void |
notifyJobSuspended(java.lang.String jobId)
Tells the protocol module to notify its client that a job has been suspended. |
(package private) abstract void |
notifyShutdown()
Tells the protocol module to notify its client that server is shutting down. |
(package private) abstract void |
startConnection()
This method tells the protocol module to begin reading messages from the established connection. |
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 SYSTEM_ID
private static final byte CURRENT_VERSION
private static final byte MIN_VERSION
private static java.util.logging.Logger log
protected static java.util.List moduleList
Constructor Detail |
public JCEPProtocolModule()
Method Detail |
static JCEPProtocolModule establishConnection(JCEPListener engine, java.net.Socket socket) throws java.io.IOException
engine
- The JCEPListener to use for sending command requests from the clientsocket
- The socket on which to connect to the client
java.io.IOException
- Thrown then the connection cannot be establishedprivate static byte doHandshake(java.io.DataInputStream din, java.io.DataOutputStream dout) throws java.io.IOException
din
- Input stream from the socketdout
- Output stream to the socket
java.io.IOException
- Thrown is there's an error during the handshake processprotected static void notifyAllModules()
abstract void startConnection() throws java.io.IOException
java.io.IOException
- Thrown if there's an error starting up the connectionabstract void closeConnection() throws java.io.IOException
java.io.IOException
- Thrown is there's an error closing the input or output streamsabstract void logMessage(java.lang.String jobId, java.lang.String message) throws java.io.IOException
jobId
- The id of the job from which the message originatedmessage
- The text of the message
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void logError(java.lang.String jobId, java.lang.String error) throws java.io.IOException
error
- The text of the error messagejobId
- The id of the job from which the error originated
java.io.IOException
- Thrown if there's an error sending the error message to the clientJCEPHandler
abstract void notifyJobStarted(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which started
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobCompleted(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which completed execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobCheckpointed(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which was checkpointed
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobStopped(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which has stopped execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobFailed(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which has stopped execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobSuspended(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which has stopped suspended execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyJobResumed(java.lang.String jobId) throws java.io.IOException
jobId
- The id of the job which has resumed execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
abstract void notifyShutdown() throws java.io.IOException
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |