Kodo 4.2.0. generated on July 28 2008

com.solarmetric.remote
Class Command

java.lang.Object
  extended by com.solarmetric.remote.Command

public abstract class Command
extends Object

Base class for commands sent from the client to the server. Each command object encompasses the command state, the execution logic, and the server's response.


Constructor Summary
Command()
           
 
Method Summary
abstract  void execute(Object context)
          Execute this command using the given context.
 long getClientId()
          The server-assigned id of the client sending the command.
 boolean hasResponse()
          Whether this command uses a response.
protected  void read(ObjectInput in)
          Read in the state of the sent command from the given stream.
protected  void readResponse(ObjectInput in)
          Read the server's response to this command.
 void setClientId(long id)
          The server-assigned id of the client sending the command.
 void setHasResponse(boolean response)
          Whether this command uses a response.
 String toString()
           
protected  void write(ObjectOutput out)
          Write this command to the given stream.
protected  void writeResponse(ObjectOutput out)
          Write the server's response to this command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Command

public Command()
Method Detail

setClientId

public void setClientId(long id)
The server-assigned id of the client sending the command.


getClientId

public long getClientId()
The server-assigned id of the client sending the command.


hasResponse

public boolean hasResponse()
Whether this command uses a response. Defaults to true. Note that if a command does not use a response, we cannot send back errors that may have occurred when executing the command.


setHasResponse

public void setHasResponse(boolean response)
Whether this command uses a response. Defaults to true. Note that if a command does not use a response, we cannot send back errors that may have occurred when executing the command.


execute

public abstract void execute(Object context)
                      throws Exception
Execute this command using the given context.

Throws:
Exception

read

protected void read(ObjectInput in)
             throws Exception
Read in the state of the sent command from the given stream. Does nothing by default.

Throws:
Exception

write

protected void write(ObjectOutput out)
              throws Exception
Write this command to the given stream. Does nothing by default.

Throws:
Exception

readResponse

protected void readResponse(ObjectInput in)
                     throws Exception
Read the server's response to this command. Does nothing by default.

Throws:
Exception

writeResponse

protected void writeResponse(ObjectOutput out)
                      throws Exception
Write the server's response to this command. Does nothing by default.

Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object

Kodo 4.2.0. generated on July 28 2008

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.