Class AsyncNodeClassContext
java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.classloader.AbstractAsyncClassContext
org.jppf.server.nio.classloader.node.AsyncNodeClassContext
- All Implemented Interfaces:
org.jppf.classloader.AsyncLocalNodeClassloaderContext,org.jppf.nio.CloseableContext,org.jppf.nio.NioChannelHandler,org.jppf.nio.NioContext
public class AsyncNodeClassContext
extends AbstractAsyncClassContext
implements org.jppf.classloader.AsyncLocalNodeClassloaderContext
- Author:
- Laurent Cohen
-
Field Summary
Fields inherited from class org.jppf.server.nio.classloader.AbstractAsyncClassContext
driver, sendQueueFields 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
ConstructorsConstructorDescriptionAsyncNodeClassContext(AsyncNodeClassNioServer server, SocketChannel socketChannel) -
Method Summary
Modifier and TypeMethodDescriptionaddPendingResponse(org.jppf.classloader.JPPFResourceWrapper resource) Add a pending response.org.jppf.classloader.JPPFResourceWrapperintGet the number of pending responses.voidvoidProcess a response ot a provider request.protected booleanDetermine whether this context relates to a provider or node connection.voidsendResponse(org.jppf.classloader.JPPFResourceWrapper response) Send a response back to the nodevoidsetLocalRequest(org.jppf.classloader.JPPFResourceWrapper localRequest) voidsetLocalResponse(org.jppf.classloader.JPPFResourceWrapper localResponse) toString()Methods inherited from class org.jppf.server.nio.classloader.AbstractAsyncClassContext
deserializeResource, getResourceName, nextMessageToSend, readMessage, serializeResource, writeMessageMethods 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
-
Constructor Details
-
AsyncNodeClassContext
- Parameters:
server- the server handling this context.socketChannel- the underlying socket channel.
-
-
Method Details
-
handleException
- Specified by:
handleExceptionin interfaceorg.jppf.nio.NioContext
-
isProvider
protected boolean isProvider()Description copied from class:AbstractAsyncClassContextDetermine whether this context relates to a provider or node connection.- Specified by:
isProviderin classAbstractAsyncClassContext- Returns:
- true if this is a provider context, false otherwise.
-
addPendingResponse
Add a pending response.- Parameters:
resource- the resource for which to await a response.- Returns:
- the new added request.
-
handleProviderResponse
Process a response ot a provider request.- Parameters:
request- the request to handle.- Throws:
Exception- if any error occurs.
-
sendResponse
Send a response back to the node- Parameters:
response- the response to send.- Throws:
Exception- if any error occurs.
-
getNbPendingResponses
public int getNbPendingResponses()Get the number of pending responses.- Returns:
- the number of pending responses as an int.
-
setLocalRequest
- Specified by:
setLocalRequestin interfaceorg.jppf.classloader.AsyncLocalNodeClassloaderContext- Throws:
Exception
-
awaitLocalResponse
- Specified by:
awaitLocalResponsein interfaceorg.jppf.classloader.AsyncLocalNodeClassloaderContext- Throws:
Exception
-
setLocalResponse
public void setLocalResponse(org.jppf.classloader.JPPFResourceWrapper localResponse) throws Exception - Specified by:
setLocalResponsein interfaceorg.jppf.classloader.AsyncLocalNodeClassloaderContext- Throws:
Exception
-
getServer
- Overrides:
getServerin classAbstractAsyncClassContext- Returns:
- the Nio server handling this context.
-
toString
- Overrides:
toStringin classorg.jppf.nio.AbstractNioContext
-