org.jppf.server.nio.nodeserver
Class LocalNodeContext

java.lang.Object
  extended by org.jppf.server.nio.AbstractNioContext<NodeState>
      extended by org.jppf.server.nio.nodeserver.AbstractNodeContext
          extended by org.jppf.server.nio.nodeserver.LocalNodeContext
All Implemented Interfaces:
NioContext<NodeState>

public class LocalNodeContext
extends AbstractNodeContext

Context associated with a channel serving tasks to a local (in-VM) node.

Author:
Laurent Cohen

Field Summary
 
Fields inherited from class org.jppf.server.nio.nodeserver.AbstractNodeContext
bundle, bundler, helper, jobCanceled, nodeMessage, nodeUuid
 
Fields inherited from class org.jppf.server.nio.AbstractNioContext
connectionUuid, message, readByteCount, state, uuid, writeByteCount
 
Constructor Summary
LocalNodeContext()
           
 
Method Summary
 AbstractNodeMessage newMessage()
          Create a new message.
 boolean readMessage(ChannelWrapper<?> channel)
          Read data from a channel.
 void setNodeMessage(AbstractNodeMessage nodeMessage, ChannelWrapper<?> channel)
          Set the message wrapping the data sent or received over the socket channel.
 void setState(NodeState state)
          Set the current state of the channel this context is associated with.
 boolean writeMessage(ChannelWrapper<?> channel)
          Write data to a channel.
 
Methods inherited from class org.jppf.server.nio.nodeserver.AbstractNodeContext
checkBundler, deserializeBundle, getBundle, getBundler, getNodeMessage, getNodeUuid, handleException, isJobCanceled, isPeer, resubmitBundle, serializeBundle, setBundle, setBundler, setJobCanceled, setNodeUuid, setPeer
 
Methods inherited from class org.jppf.server.nio.AbstractNioContext
getChannel, getConnectionUuid, getMessage, getShortClassName, getState, getUuid, setChannel, setConnectionUuid, setMessage, setUuid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalNodeContext

public LocalNodeContext()
Method Detail

newMessage

public AbstractNodeMessage newMessage()
Create a new message..

Specified by:
newMessage in class AbstractNodeContext
Returns:
an AbstractNodeMessage instance.

readMessage

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

Specified by:
readMessage in interface NioContext<NodeState>
Overrides:
readMessage in class AbstractNodeContext
Parameters:
channel - 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<?> channel)
                     throws Exception
Write data to a channel.

Specified by:
writeMessage in interface NioContext<NodeState>
Overrides:
writeMessage in class AbstractNodeContext
Parameters:
channel - 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.

setNodeMessage

public void setNodeMessage(AbstractNodeMessage nodeMessage,
                           ChannelWrapper<?> channel)
Set the message wrapping the data sent or received over the socket channel.

Overrides:
setNodeMessage in class AbstractNodeContext
Parameters:
nodeMessage - a NodeMessage instance.
channel - reference to the channel.

setState

public void setState(NodeState state)
Set the current state of the channel this context is associated with.

Specified by:
setState in interface NioContext<NodeState>
Overrides:
setState in class AbstractNioContext<NodeState>
Parameters:
state - a state enum value.


Copyright © 2005-2010 JPPF Team.