java.lang.Object
org.glassfish.grizzly.ReadResult<K,L>
- Type Parameters:
K- type of the messageL- type of the address
- Direct Known Subclasses:
RecordReadResult
Result of read operation, returned by
Readable.- Author:
- Alexey Stashok
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedReadResult(Connection<L> connection) protectedReadResult(Connection<L> connection, K message, L srcAddress, int readSize) -
Method Summary
Modifier and TypeMethodDescriptioncopy()static <K,L> ReadResult<K, L> create(Connection<L> connection) static <K,L> ReadResult<K, L> create(Connection<L> connection, K message, L srcAddress, int readSize) final Connection<L>Get theConnectiondata were read from.final KGet the message, which was read.final intGet the number of bytes, which were read.final LGet the source address, the message was read from.Get the source address, the message was read from.voidrecycle()protected voidreset()protected voidset(Connection<L> connection, K message, L srcAddress, int readSize) One method to set all the WriteResult properties.final voidsetMessage(K message) Set the message, which was read.final voidsetReadSize(int readSize) Set the number of bytes, which were read.final voidsetSrcAddress(L srcAddress) Set the source address, the message was read from.final voidsetSrcAddressHolder(Holder<L> srcAddressHolder) Set the source address, the message was read from.
-
Constructor Details
-
ReadResult
protected ReadResult() -
ReadResult
-
ReadResult
-
-
Method Details
-
create
-
create
public static <K,L> ReadResult<K,L> create(Connection<L> connection, K message, L srcAddress, int readSize) -
getConnection
Get theConnectiondata were read from.- Specified by:
getConnectionin interfaceResult- Returns:
- the
Connectiondata were read from.
-
getMessage
Get the message, which was read.- Returns:
- the message, which was read.
-
setMessage
Set the message, which was read.- Parameters:
message- the message, which was read.
-
getSrcAddress
Get the source address, the message was read from.- Returns:
- the source address, the message was read from.
-
getSrcAddressHolder
Get the source address, the message was read from.- Returns:
- the source address, the message was read from.
-
setSrcAddress
Set the source address, the message was read from.- Parameters:
srcAddress- the source address, the message was read from.
-
setSrcAddressHolder
Set the source address, the message was read from.- Parameters:
srcAddressHolder- the source address, the message was read from.
-
getReadSize
public final int getReadSize()Get the number of bytes, which were read.- Returns:
- the number of bytes, which were read.
-
setReadSize
public final void setReadSize(int readSize) Set the number of bytes, which were read.- Parameters:
readSize- the number of bytes, which were read.
-
set
One method to set all the WriteResult properties.- Parameters:
connection- the connection the data was read frommessage- the message which was readsrcAddress- the source address the message was read fromreadSize- number of bytes which were read
-
reset
protected void reset() -
recycle
public void recycle() -
copy
-