Package org.jppf.server.nio.classloader
Class AbstractAsyncClassContext
java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.classloader.AbstractAsyncClassContext
- All Implemented Interfaces:
org.jppf.nio.CloseableContext,org.jppf.nio.NioChannelHandler,org.jppf.nio.NioContext
- Direct Known Subclasses:
AsyncClientClassContext,AsyncNodeClassContext
public abstract class AbstractAsyncClassContext
extends org.jppf.nio.AbstractNioContext
Context object associated with a socket channel used by the class server of the JPPF driver.
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final JPPFDriverReference to the driver.protected final BlockingQueue<org.jppf.nio.ClassLoaderNioMessage>This queue contains all the result bundles to send back to the node.Fields inherited from class org.jppf.nio.AbstractNioContext
closed, connectionUuid, enabled, inSnapshot, local, onCloseAction, outSnapshot, peer, readByteCount, readMessage, socketChannel, ssl, sslHandler, uuid, writeByteCount, writeMessage -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAsyncClassContext(JPPFDriver driver, org.jppf.nio.StatelessNioServer<? extends AbstractAsyncClassContext> server) -
Method Summary
Modifier and TypeMethodDescriptionorg.jppf.classloader.JPPFResourceWrapperdeserializeResource(org.jppf.nio.ClassLoaderNioMessage message) Deserialize a resource wrapper from an array of bytes.static StringgetResourceName(org.jppf.classloader.JPPFResourceWrapper resource) Determine whether the specified resource is a request for a single resource definition.org.jppf.nio.StatelessNioServer<? extends AbstractAsyncClassContext>protected abstract booleanDetermine whether this context relates to a provider or node connection.protected org.jppf.nio.ClassLoaderNioMessagebooleanorg.jppf.nio.ClassLoaderNioMessageserializeResource(org.jppf.classloader.JPPFResourceWrapper resource) Serialize a resource wrapper to an array of bytes.booleanMethods inherited from class org.jppf.nio.AbstractNioContext
getConnectionUuid, getInterestOps, getReadMessage, getSelectionKey, getSocketChannel, getSSLHandler, getUuid, getWriteMessage, isClosed, isEnabled, isLocal, isPeer, isSecure, isSsl, onClose, setClosed, setConnectionUuid, setEnabled, setInterestOps, setLocal, setOnCloseAction, setPeer, setReadMessage, setSelectionKey, setSsl, setSSLHandler, setUuid, setWriteMessage, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.nio.NioContext
handleException
-
Field Details
-
driver
Reference to the driver. -
sendQueue
This queue contains all the result bundles to send back to the node.
-
-
Constructor Details
-
AbstractAsyncClassContext
public AbstractAsyncClassContext(JPPFDriver driver, org.jppf.nio.StatelessNioServer<? extends AbstractAsyncClassContext> server) - Parameters:
driver- reference to the JPPF driver.server- the server handling this context.
-
-
Method Details
-
deserializeResource
public org.jppf.classloader.JPPFResourceWrapper deserializeResource(org.jppf.nio.ClassLoaderNioMessage message) throws Exception Deserialize a resource wrapper from an array of bytes.- Parameters:
message- the message to deserialize.- Returns:
- a
JPPFResourceWrapperinstance. - Throws:
Exception- if an error occurs while deserializing.
-
serializeResource
public org.jppf.nio.ClassLoaderNioMessage serializeResource(org.jppf.classloader.JPPFResourceWrapper resource) throws Exception Serialize a resource wrapper to an array of bytes.- Parameters:
resource- the resource to serialize.- Returns:
- a
ClassLoaderNioMessageinstance. - Throws:
Exception- if an error occurs while serializing.
-
isProvider
protected abstract boolean isProvider()Determine whether this context relates to a provider or node connection.- Returns:
- true if this is a provider context, false otherwise.
-
readMessage
- Throws:
Exception
-
writeMessage
- Throws:
Exception
-
getResourceName
Determine whether the specified resource is a request for a single resource definition.- Parameters:
resource- the resource to check.- Returns:
trueif the specified resource is a request for a single resource definition,falseotherwise.
-
getServer
- Returns:
- the Nio server handling this context.
-
nextMessageToSend
protected org.jppf.nio.ClassLoaderNioMessage nextMessageToSend()- Overrides:
nextMessageToSendin classorg.jppf.nio.AbstractNioContext
-