org.jppf.server.nio.classloader
Class LocalClassContext

java.lang.Object
  extended by org.jppf.server.nio.AbstractNioContext<S>
      extended by org.jppf.server.nio.SimpleNioContext<ClassState>
          extended by org.jppf.server.nio.classloader.ClassContext
              extended by org.jppf.server.nio.classloader.LocalClassContext
All Implemented Interfaces:
NioContext<ClassState>

public class LocalClassContext
extends ClassContext

Context object associated with a socket channel used by the class server of the JPPF driver.

Author:
Laurent Cohen

Field Summary
 
Fields inherited from class org.jppf.server.nio.classloader.ClassContext
currentRequest, pendingRequests, provider, resource
 
Fields inherited from class org.jppf.server.nio.AbstractNioContext
connectionUuid, message, readByteCount, state, uuid, writeByteCount
 
Constructor Summary
LocalClassContext()
           
 
Method Summary
 JPPFResourceWrapper deserializeResource()
          Deserialize a resource wrapper from an array of bytes.
 boolean readMessage(ChannelWrapper<?> wrapper)
          Read data from a channel.
 void serializeResource(ChannelWrapper<?> wrapper)
          Serialize a resource wrapper to an array of bytes.
 boolean writeMessage(ChannelWrapper<?> wrapper)
          Write data to a channel.
 
Methods inherited from class org.jppf.server.nio.classloader.ClassContext
addRequest, getCurrentRequest, getNbPendingRequests, getPendingRequests, getResource, handleException, handleProviderError, isProvider, resetNodeState, sendNullResponse, setCurrentRequest, setPendingRequests, setProvider, setResource
 
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
 

Constructor Detail

LocalClassContext

public LocalClassContext()
Method Detail

serializeResource

public void serializeResource(ChannelWrapper<?> wrapper)
                       throws Exception
Serialize a resource wrapper to an array of bytes.

Overrides:
serializeResource in class ClassContext
Parameters:
wrapper - the channel through which the resource is sent.
Throws:
Exception - if an error occurs while serializing.

deserializeResource

public JPPFResourceWrapper deserializeResource()
                                        throws Exception
Deserialize a resource wrapper from an array of bytes.

Overrides:
deserializeResource in class ClassContext
Returns:
a JPPFResourceWrapper instance.
Throws:
Exception - if an error occurs while deserializing.

readMessage

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

Specified by:
readMessage in interface NioContext<ClassState>
Overrides:
readMessage in class SimpleNioContext<ClassState>
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.

Specified by:
writeMessage in interface NioContext<ClassState>
Overrides:
writeMessage in class SimpleNioContext<ClassState>
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.