Package org.jppf.nio
Class NioMessageReader<C extends AbstractNioContext>
java.lang.Object
org.jppf.nio.NioMessageReader<C>
- Type Parameters:
C- the type of connection context.
Reads from the channel until no more data is available. Each fully read message is handed off to a global thread pool for deserialization and processing.
- Author:
- Laurent Cohen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final NioMessageReader.MessageHandler<C>protected final StatelessNioServer<C>The server handling the connections.d -
Constructor Summary
ConstructorsConstructorDescriptionNioMessageReader(StatelessNioServer<C> server) Initialize this message reader. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract NioMessageReader.MessageHandler<C>Create a handling task with the specified context and message.protected ExecutorServiceprotected voidRead from the channel until no more data is available (i.e. socket receive buffer is empty).
-
Field Details
-
server
The server handling the connections.d -
messageHandler
-
-
Constructor Details
-
NioMessageReader
Initialize this message reader.- Parameters:
server- the nio server.
-
-
Method Details
-
read
Read from the channel until no more data is available (i.e. socket receive buffer is empty).- Parameters:
context- the JMX context that reads the data.- Throws:
Exception- if any error occurs.
-
getExecutor
- Returns:
- the exeuctor to use to handle messages.
-
createMessageHandler
Create a handling task with the specified context and message.- Returns:
- the created task.
-