|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.solarmetric.remote.CommandIO
public class CommandIO
Manages command input and output.
Constructor Summary | |
---|---|
CommandIO()
Default constructor. |
|
CommandIO(ContextFactory context,
Log log)
Constructor. |
Method Summary | |
---|---|
boolean |
execute(Transport.Channel channel)
Execute a command via the given channel. |
ContextFactory |
getContextFactory()
A context factory to use to given executed commands context. |
Log |
getLog()
A log to write about sent and recieved a commands. |
protected ObjectInput |
getObjectInput(InputStream in)
Create an ObjectInput instance from the given stream. |
protected ObjectOutput |
getObjectOutput(OutputStream out)
Create an ObjectOutput instance from the given stream. |
StreamDecorator[] |
getStreamDecorators()
Stream decorators. |
protected Command |
readType(ObjectInput in)
Read the command type from the given stream and return a new command of the proper type. |
void |
send(Command cmd,
Transport.Channel channel)
Send a command via the given channel. |
void |
setContextFactory(ContextFactory context)
A context factory to use to given executed commands context. |
void |
setLog(Log log)
A log to write about sent and recieved a commands. |
void |
setStreamDecorators(StreamDecorator[] streamDecs)
Stream decorators. |
void |
test(Transport.Channel channel)
Test that the given client channel is still connected. |
protected void |
writeType(Command cmd,
ObjectOutput out)
Write the type of this command to the given stream so that readType(java.io.ObjectInput) will be able to reconstruct the command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandIO()
public CommandIO(ContextFactory context, Log log)
Method Detail |
---|
public Log getLog()
public void setLog(Log log)
public StreamDecorator[] getStreamDecorators()
public void setStreamDecorators(StreamDecorator[] streamDecs)
public ContextFactory getContextFactory()
public void setContextFactory(ContextFactory context)
public boolean execute(Transport.Channel channel)
TransportException
- on transport errorpublic void send(Command cmd, Transport.Channel channel) throws Exception
TransportException
- on transport error
Exception
- if the command caused an error on the serverpublic void test(Transport.Channel channel) throws Exception
Exception
protected Command readType(ObjectInput in) throws Exception
Exception
protected void writeType(Command cmd, ObjectOutput out) throws Exception
readType(java.io.ObjectInput)
will be able to reconstruct the command. By default,
this method writes the command class name to the stream.
Exception
protected ObjectInput getObjectInput(InputStream in) throws Exception
ObjectInput
instance from the given stream.
This default implementation uses a standard ObjectInputStream
.
Exception
protected ObjectOutput getObjectOutput(OutputStream out) throws Exception
ObjectOutput
instance from the given stream.
This default implementation uses a standard ObjectOutputStream
.
Exception
|
Kodo 4.2.0. generated on July 28 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |