SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

com.solarmetric.remote
Class CommandIO

java.lang.Object
  |
  +--com.solarmetric.remote.CommandIO

public class CommandIO
extends Object

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  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 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

CommandIO

public CommandIO()
Default constructor.

CommandIO

public CommandIO(ContextFactory context,
                 Log log)
Constructor. Supply context factory and log.
Method Detail

getLog

public Log getLog()
A log to write about sent and recieved a commands.

setLog

public void setLog(Log log)
A log to write about sent and recieved a commands.

getContextFactory

public ContextFactory getContextFactory()
A context factory to use to given executed commands context.

setContextFactory

public void setContextFactory(ContextFactory context)
A context factory to use to given executed commands context.

execute

public boolean execute(Transport.Channel channel)
Execute a command via the given channel.
Returns:
false if the channel to the client should be closed, true otherwise
Throws:
TransportException - on transport error

send

public void send(Command cmd,
                 Transport.Channel channel)
          throws Exception
Send a command via the given channel.
Throws:
TransportException - on transport error
Exception - if the command caused an error on the server

test

public void test(Transport.Channel channel)
          throws Exception
Test that the given client channel is still connected.

readType

protected Command readType(ObjectInput in)
                    throws Exception
Read the command type from the given stream and return a new command of the proper type. By default, this method assumes the next item in the stream is a class name.

writeType

protected void writeType(Command cmd,
                         ObjectOutput out)
                  throws Exception
Write the type of this command to the given stream so that readType(java.io.ObjectInput) will be able to reconstruct the command. By default, this method writes the command class name to the stream.

SolarMetric Kodo JDO 3.1.6 generated on August 25 2004

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.