org.jppf.server.nio
Class SimpleNioContext<S extends Enum<S>>

java.lang.Object
  extended by org.jppf.server.nio.AbstractNioContext<S>
      extended by org.jppf.server.nio.SimpleNioContext<S>
Type Parameters:
S - the type of states associated with this context.
All Implemented Interfaces:
NioContext<S>
Direct Known Subclasses:
ClassContext, MultiplexerContext, MultiplexerContext

public abstract class SimpleNioContext<S extends Enum<S>>
extends AbstractNioContext<S>

Context associated with an open socket channel.

Author:
Laurent Cohen

Field Summary
 
Fields inherited from class org.jppf.server.nio.AbstractNioContext
connectionUuid, message, readByteCount, state, uuid, writeByteCount
 
Constructor Summary
SimpleNioContext()
           
 
Method Summary
 boolean readMessage(ChannelWrapper<?> wrapper)
          Read data from a channel.
 boolean writeMessage(ChannelWrapper<?> wrapper)
          Write data to a channel.
 
Methods inherited from class org.jppf.server.nio.AbstractNioContext
getChannel, getConnectionUuid, getMessage, getShortClassName, getState, getUuid, setChannel, setConnectionUuid, setMessage, setState, setUuid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jppf.server.nio.NioContext
handleException
 

Constructor Detail

SimpleNioContext

public SimpleNioContext()
Method Detail

readMessage

public boolean readMessage(ChannelWrapper<?> wrapper)
                    throws Exception
Read data from a channel.

Parameters:
wrapper - the channel to read the data from.
Returns:
true if all the data has been read, false otherwise.
Throws:
Exception - if an error occurs while reading the data.

writeMessage

public boolean writeMessage(ChannelWrapper<?> wrapper)
                     throws Exception
Write data to a channel.

Parameters:
wrapper - the channel to write the data to.
Returns:
true if all the data has been written, false otherwise.
Throws:
Exception - if an error occurs while writing the data.


Copyright © 2005-2010 JPPF Team.