Class AsyncClientClassContext
java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.classloader.AbstractAsyncClassContext
org.jppf.server.nio.classloader.client.AsyncClientClassContext
- All Implemented Interfaces:
org.jppf.nio.CloseableContext,org.jppf.nio.NioChannelHandler,org.jppf.nio.NioContext
Context or state information associated with a channel that exchanges heartbeat messages between the server and a node or client.
- 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequest(AsyncResourceRequest request) Add a new request to send to the client.intgetRequests(org.jppf.classloader.JPPFResourceWrapper resource) Retrieve the request matching a specified resource.voidprotected voidHandle the scenario where an exception occurs while sending a request to or receiving a response from a provider, and a node channel is waiting for the response.protected booleanDetermine whether this context relates to a provider or node connection.voidofferMessageToSend(org.jppf.nio.ClassLoaderNioMessage message) Add the specified message to the send queue.removeRequest(org.jppf.classloader.JPPFResourceWrapper resource) Remove the request matching a specified resource.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
-
Method Details
-
handleException
-
handleProviderError
protected void handleProviderError()Handle the scenario where an exception occurs while sending a request to or receiving a response from a provider, and a node channel is waiting for the response. -
offerMessageToSend
Add the specified message to the send queue.- Parameters:
message- the message to add to the queue.- Throws:
Exception- if any error occurs.
-
addRequest
Add a new request to send to the client.- Parameters:
request- the requets to send.- Throws:
Exception- if any error occurs.
-
getNbPendingRequests
public int getNbPendingRequests()- Returns:
- the number of pending requests.
-
getRequests
Retrieve the request matching a specified resource.- Parameters:
resource- the key in the request map.- Returns:
- an
AsyncResourceRequestinstance, ornullif there is no entry with the specified resource.
-
removeRequest
Remove the request matching a specified resource.- Parameters:
resource- the key in the request map.- Returns:
- the removed
AsyncResourceRequestinstance, ornullif there is no entry with the specified id.
-
toString
- Overrides:
toStringin classorg.jppf.nio.AbstractNioContext
-
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.
-
getServer
- Overrides:
getServerin classAbstractAsyncClassContext- Returns:
- the Nio server handling this context.
-