Package org.jppf.nio
Class AbstractNioMessageBase
java.lang.Object
org.jppf.nio.AbstractNioMessageBase
- All Implemented Interfaces:
NioMessage
- Direct Known Subclasses:
AbstractNioMessage,SimpleNioMessage
Common abstract superclass representing a message sent or received by a channel.
A message is the transformation of a sequence of objects into a more easily transportable format.
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final NioContextThe channel to read from or write to.protected longActual bytes sent to or received from the underlying channel.protected longActual bytes sent to or received from the underlying channel.protected intThe current count of bytes sent or received.protected DataLocationTemporary holder used as a local performance optimization for write operations.protected intThe length of the location at the current position.protected NioObjectObject storing the length of the object currently being read or written.protected NioObjectObject storing the object currently being read or written.protected final MultipleBuffersLocationReusable buffer for reading/writing serialized object lengths.protected booleanprotected final booleantrueis data is read from or written an SSL connection,falseotherwise.protected final SSLHandlerWraps a channel associated with anSSLEngine.protected longprotected longFields inherited from interface org.jppf.nio.NioMessage
READ, WRITE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractNioMessageBase(NioContext channel) Initialize this nio message. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the actual bytes received from the underlying channel.longGet the actual bytes sent to the underlying channel.Get the data location objects abstracting the data to send or receive.booleanisSSL()Determines whether this message read from / writes to an SSL connection.protected voidupdateCounts(long update, int op) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jppf.nio.NioMessage
read, write
-
Field Details
-
count
protected int countThe current count of bytes sent or received. -
currentDataLocation
Temporary holder used as a local performance optimization for write operations. -
currentLength
protected int currentLengthThe length of the location at the current position. -
currentLengthObject
Object storing the length of the object currently being read or written. -
resetCurrentLength
protected boolean resetCurrentLength -
currentObject
Object storing the object currently being read or written. -
ssl
protected final boolean ssltrueis data is read from or written an SSL connection,falseotherwise. -
sslHandler
Wraps a channel associated with anSSLEngine. -
channelReadCount
protected long channelReadCountActual bytes sent to or received from the underlying channel. -
channelWriteCount
protected long channelWriteCountActual bytes sent to or received from the underlying channel. -
channel
The channel to read from or write to. -
lengthBuf
Reusable buffer for reading/writing serialized object lengths. -
sslHandlerReadCount
protected long sslHandlerReadCount -
sslHandlerWriteCount
protected long sslHandlerWriteCount
-
-
Constructor Details
-
AbstractNioMessageBase
Initialize this nio message.- Parameters:
channel- the channel to read from or write to.
-
-
Method Details
-
isSSL
public boolean isSSL()Description copied from interface:NioMessageDetermines whether this message read from / writes to an SSL connection.- Specified by:
isSSLin interfaceNioMessage- Returns:
trueis data is read from or written an SSL connection,falseotherwise.
-
getChannelReadCount
public long getChannelReadCount()Description copied from interface:NioMessageGet the actual bytes received from the underlying channel.- Specified by:
getChannelReadCountin interfaceNioMessage- Returns:
- the number of bytes as a long value.
-
getChannelWriteCount
public long getChannelWriteCount()Description copied from interface:NioMessageGet the actual bytes sent to the underlying channel.- Specified by:
getChannelWriteCountin interfaceNioMessage- Returns:
- the number of bytes as a long value.
-
getCurrentDataLocation
Get the data location objects abstracting the data to send or receive.- Returns:
- a
DataLocationobject.
-
updateCounts
protected void updateCounts(long update, int op) - Parameters:
update- the update value.op- the type of operation, and therefore which counter to upddate.
-