Package org.jppf.nio
Class NioMessageWriter<C extends AbstractNioContext>
java.lang.Object
org.jppf.nio.NioMessageWriter<C>
- Type Parameters:
C- the type of connection context.
Writes all messages in the channel's context queue, if any, or keeps writing the current message until the socket send buffer is full.
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final StatelessNioServer<C>The server handling the connections. -
Constructor Summary
ConstructorsConstructorDescriptionNioMessageWriter(StatelessNioServer<C> server) Initialize this message writer. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanWrite to the specified channel.protected abstract voidpostWrite(C context, NioMessage data) Method called after a message is sent to the remote peer.protected voidpreWrite(C context, NioMessage data) Method called just before a message is sent to the remote peer.protected booleanWrite to the specified channel.
-
Field Details
-
server
The server handling the connections.
-
-
Constructor Details
-
NioMessageWriter
Initialize this message writer.- Parameters:
server- the nio server.
-
-
Method Details
-
write
Write to the specified channel.- Parameters:
context- the context to write to.- Returns:
trueif there is more to write, but the socket send buffer is full,falseotherwise.- Throws:
Exception- if any errort occurs.
-
doWrite
Write to the specified channel.- Parameters:
context- the context to write to.- Returns:
trueif there is more to write, but the socket send buffer is full,falseotherwise.- Throws:
Exception- if any error occurs.
-
preWrite
Method called just before a message is sent to the remote peer.- Parameters:
context- the context that sent the message.data- the message sent.- Throws:
Exception- if any error occurs.
-
postWrite
Method called after a message is sent to the remote peer.- Parameters:
context- the context that sent the message.data- the message sent.- Throws:
Exception- if any error occurs.
-