Package org.jppf.server.nio.client
Class AsyncClientContext
java.lang.Object
org.jppf.nio.AbstractNioContext
org.jppf.server.nio.client.AsyncClientContext
- All Implemented Interfaces:
org.jppf.nio.CloseableContext,org.jppf.nio.NioChannelHandler,org.jppf.nio.NioContext
public class AsyncClientContext
extends org.jppf.nio.AbstractNioContext
Context or state information associated with a channel that exchanges heartbeat messages between the server and a node or client.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested Classes -
Field Summary
Fields 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 TypeMethodDescriptionvoidaddEntry(ServerTaskBundleClient bundle) Add a new job to the job map.deserializeBundle(ClientMessage message) Deserialize a task bundle from a message read from a connection.getJobEntry(String jobUuid, long bundleId) Retrieve the job entry with the specified id.voidnewMessage(ServerTaskBundleClient clientBundle) Create a new message.protected ClientMessagebooleanremoveJobEntry(String jobUuid, long bundleId) Remove the job entry with the specified id.Serialize specified bundle into a message to send.toString()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
-
Method Details
-
handleException
-
serializeBundle
Serialize specified bundle into a message to send.- Parameters:
bundle- the byndle to process.- Returns:
- the created message.
- Throws:
Exception- if any error occurs.
-
deserializeBundle
Deserialize a task bundle from a message read from a connection.- Parameters:
message- the message to process.- Returns:
- a
ClientContextinstance. - Throws:
Exception- if an error occurs during the deserialization.
-
newMessage
Create a new message.- Parameters:
clientBundle- the actual client task bundle from which this message is created.- Returns:
- an
ClientMessageinstance.
-
readMessage
- Throws:
Exception
-
writeMessage
- Throws:
Exception
-
getJobEntry
Retrieve the job entry with the specified id.- Parameters:
jobUuid- the uuid of the job whose entry to retrieve.bundleId- the id of the client job bundle for the entry.- Returns:
- a
JobEntryinstance, ornullif there is no entry with the specified id.
-
addEntry
Add a new job to the job map.- Parameters:
bundle- the job to add.
-
removeJobEntry
Remove the job entry with the specified id.- Parameters:
jobUuid- the uuid of the job whose entry to retrieve.bundleId- the id of the client job bundle for the entry.- Returns:
- the removed
JobEntryinstance, ornullif there is no entry with the specified id.
-
nextMessageToSend
- Overrides:
nextMessageToSendin classorg.jppf.nio.AbstractNioContext
-
toString
- Overrides:
toStringin classorg.jppf.nio.AbstractNioContext
-
getEntrystats
- Returns:
- the job entry stats.
-
getEntryMap
- Returns:
- a map of the client bundles sent over this connection.
-