org.globus.cog.karajan.workflow.service.commands
Class Command

java.lang.Object
  extended by org.globus.cog.karajan.workflow.service.RequestReply
      extended by org.globus.cog.karajan.workflow.service.commands.Command
Direct Known Subclasses:
ChannelConfigurationCommand, EchoCommand, EventCommand, GroupCommand, ShutdownCommand, StartCommand, StatCommand, SubmitCommand, TestCommand, UploadInstance, VargCommand, VersionCommand

public abstract class Command
extends RequestReply


Nested Class Summary
static interface Command.Callback
           
 
Field Summary
static int DEFAULT_REPLY_TIMEOUT
           
 
Fields inherited from class org.globus.cog.karajan.workflow.service.RequestReply
NOID
 
Constructor Summary
Command()
           
Command(String cmd)
           
 
Method Summary
 void channelClosed()
           
 void dataReceived(byte[] data)
           
 void errorReceived(String msg, Exception t)
           
 byte[] execute(KarajanChannel channel)
           
 void executeAsync(KarajanChannel channel)
           
 int getReplyTimeout()
           
protected  String ppInData(String prefix)
           
protected  String ppOutData(String prefix)
           
 void receiveCompleted()
           
protected  void reexecute()
           
 void replyReceived(byte[] data)
           
 void send()
           
 void setCallback(Command.Callback cb)
           
 void setReplyTimeout(int replyTimeout)
           
 void waitForReply()
           
 
Methods inherited from class org.globus.cog.karajan.workflow.service.RequestReply
addInData, addOutData, addOutData, addOutObject, deserialize, errorReceived, getChannel, getErrorFlag, getId, getInCmd, getInData, getInData, getInDataChuncks, getInObject, getOutCmd, getOutData, isInDataReceived, ppData, raiseErrorFlag, register, sendError, sendError, serialize, setId, setInCmd, setInData, setOutCmd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_REPLY_TIMEOUT

public static final int DEFAULT_REPLY_TIMEOUT
See Also:
Constant Field Values
Constructor Detail

Command

public Command()

Command

public Command(String cmd)
Method Detail

setCallback

public void setCallback(Command.Callback cb)

waitForReply

public void waitForReply()
                  throws ReplyTimeoutException
Throws:
ReplyTimeoutException

dataReceived

public void dataReceived(byte[] data)
Specified by:
dataReceived in class RequestReply

replyReceived

public void replyReceived(byte[] data)

send

public void send()
          throws ProtocolException
Specified by:
send in class RequestReply
Throws:
ProtocolException

execute

public byte[] execute(KarajanChannel channel)
               throws ProtocolException,
                      IOException
Throws:
ProtocolException
IOException

executeAsync

public void executeAsync(KarajanChannel channel)
                  throws ProtocolException
Throws:
ProtocolException

getReplyTimeout

public int getReplyTimeout()

setReplyTimeout

public void setReplyTimeout(int replyTimeout)

receiveCompleted

public void receiveCompleted()
Overrides:
receiveCompleted in class RequestReply

errorReceived

public void errorReceived(String msg,
                          Exception t)
Specified by:
errorReceived in class RequestReply

ppOutData

protected String ppOutData(String prefix)

ppInData

protected String ppInData(String prefix)

channelClosed

public void channelClosed()
Overrides:
channelClosed in class RequestReply

reexecute

protected void reexecute()