|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grid.jgrid.server.JCEPProtocolModule
com.sun.grid.jgrid.server.JCEPVersion10Module
This class implements the 1.0 version of JCEP.
JCEPProtocolModule
Nested Class Summary | |
private class |
JCEPVersion10Module.ListenerThread
This class reads incoming messages from the input stream and forwards the resulting commands through the protocol module. |
Field Summary | |
private java.io.DataInputStream |
din
The input stream used to communicate with the client |
private java.io.DataOutputStream |
dout
The output stream used to communicate with the client |
private JCEPListener |
engine
The JCEPListener at which to direct command received from the client |
private static java.util.logging.Logger |
log
The logging mechanism |
private JCEPVersion10Module.ListenerThread |
reader
The thread which listens for incoming client messages |
private java.lang.String |
registeredJobId
The id of the job with which this protocol module is registered to receive events |
private boolean |
shuttingDown
A flag used to prevent multiple shutdown notices |
private java.net.Socket |
socket
The socket connected to the client |
Fields inherited from class com.sun.grid.jgrid.server.JCEPProtocolModule |
moduleList, SYSTEM_ID |
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 | |
(package private) |
JCEPVersion10Module(JCEPListener engine,
java.net.Socket socket,
java.io.DataInputStream din,
java.io.DataOutputStream dout)
Creates a new instance of JCEPVersion10Module |
Method Summary | |
(package private) void |
closeConnection()
This method shuts down the protocol module. |
private void |
closeSocket()
Closes the client connection. |
(package private) void |
logError(java.lang.String jobId,
java.lang.String message)
Tells the protocol module to notify its client of an error from an executing job. |
(package private) 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. |
private void |
notifyCommandFailed(byte command,
java.lang.String jobId,
java.lang.String message)
Tells the protocol module to notify its client that a previously submitted command has failed to execute. |
(package private) void |
notifyJobCheckpointed(java.lang.String jobId)
Tells the protocol module to notify its client that a job has been checkpointed. |
(package private) void |
notifyJobCompleted(java.lang.String jobId)
Tells the protocol module to notify its client that a job has completed execution normally. |
(package private) 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) void |
notifyJobResumed(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) void |
notifyJobStarted(java.lang.String jobId)
Tells the protocol module to notify its client that a job has started execution. |
private void |
notifyJobStateChange(java.lang.String jobId,
byte newState)
Tells the protocol module to notify its client that a job has changed state. |
(package private) 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) void |
notifyJobSuspended(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) void |
notifyShutdown()
Tells the protocol module to notify its client that server is shutting down. |
(package private) void |
startConnection()
This method tells the protocol module to begin reading messages from the established connection. |
Methods inherited from class com.sun.grid.jgrid.server.JCEPProtocolModule |
establishConnection, notifyAllModules |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.util.logging.Logger log
private java.io.DataInputStream din
private java.io.DataOutputStream dout
private JCEPListener engine
private JCEPVersion10Module.ListenerThread reader
private java.lang.String registeredJobId
private java.net.Socket socket
private boolean shuttingDown
Constructor Detail |
JCEPVersion10Module(JCEPListener engine, java.net.Socket socket, java.io.DataInputStream din, java.io.DataOutputStream dout)
engine
- The JCEPListener at which to direct commands received from the clientsocket
- The socket to use for client communicationsdin
- The socket input streamdout
- The socket output streamMethod Detail |
void startConnection()
startConnection
in class JCEPProtocolModule
void logError(java.lang.String jobId, java.lang.String message) throws java.io.IOException
logError
in class JCEPProtocolModule
message
- 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
void logMessage(java.lang.String jobId, java.lang.String message) throws java.io.IOException
logMessage
in class JCEPProtocolModule
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
void notifyJobCompleted(java.lang.String jobId) throws java.io.IOException
notifyJobCompleted
in class JCEPProtocolModule
jobId
- The id of the job which completed execution
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
void notifyJobStarted(java.lang.String jobId) throws java.io.IOException
notifyJobStarted
in class JCEPProtocolModule
jobId
- The id of the job which started
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
void closeConnection()
closeConnection
in class JCEPProtocolModule
void notifyJobStopped(java.lang.String jobId) throws java.io.IOException
notifyJobStopped
in class JCEPProtocolModule
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
void notifyJobFailed(java.lang.String jobId) throws java.io.IOException
notifyJobFailed
in class JCEPProtocolModule
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
void notifyJobSuspended(java.lang.String jobId) throws java.io.IOException
notifyJobSuspended
in class JCEPProtocolModule
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
void notifyJobResumed(java.lang.String jobId) throws java.io.IOException
notifyJobResumed
in class JCEPProtocolModule
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
void notifyShutdown() throws java.io.IOException
notifyShutdown
in class JCEPProtocolModule
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
void notifyJobCheckpointed(java.lang.String jobId) throws java.io.IOException
notifyJobCheckpointed
in class JCEPProtocolModule
jobId
- The id of the job which was checkpointed
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
private void notifyCommandFailed(byte command, java.lang.String jobId, java.lang.String message) throws java.io.IOException
command
- the command that failedjobId
- The id of the job on which the command was supposed to operatemessage
- A message describing the reason for the command failure
java.io.IOException
- Thrown if there's an error sending the message to the clientJCEPHandler
private void closeSocket()
private void notifyJobStateChange(java.lang.String jobId, byte newState) throws java.io.IOException
jobId
- The id of the job which completed executionnewState
- the job's new state
java.io.IOException
- Thrown if there's an error sending the message to the client
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |