Package org.glassfish.grizzly
Class ReadResult<K,L>
- java.lang.Object
-
- org.glassfish.grizzly.ReadResult<K,L>
-
- Type Parameters:
K
- type of the messageL
- type of the address
- Direct Known Subclasses:
RecordReadResult
public class ReadResult<K,L> extends Object implements Result, Cacheable
Result of read operation, returned byReadable
.- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ReadResult()
protected
ReadResult(Connection<L> connection)
protected
ReadResult(Connection<L> connection, K message, L srcAddress, int readSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
copy()
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)
Connection<L>
getConnection()
Get theConnection
data were read from.K
getMessage()
Get the message, which was read.int
getReadSize()
Get the number of bytes, which were read.L
getSrcAddress()
Get the source address, the message was read from.Holder<L>
getSrcAddressHolder()
Get the source address, the message was read from.void
recycle()
protected void
reset()
protected void
set(Connection<L> connection, K message, L srcAddress, int readSize)
One method to set all the WriteResult properties.void
setMessage(K message)
Set the message, which was read.void
setReadSize(int readSize)
Set the number of bytes, which were read.void
setSrcAddress(L srcAddress)
Set the source address, the message was read from.void
setSrcAddressHolder(Holder<L> srcAddressHolder)
Set the source address, the message was read from.
-
-
-
Constructor Detail
-
ReadResult
protected ReadResult()
-
ReadResult
protected ReadResult(Connection<L> connection)
-
ReadResult
protected ReadResult(Connection<L> connection, K message, L srcAddress, int readSize)
-
-
Method Detail
-
create
public static <K,L> ReadResult<K,L> create(Connection<L> connection)
-
create
public static <K,L> ReadResult<K,L> create(Connection<L> connection, K message, L srcAddress, int readSize)
-
getConnection
public final Connection<L> getConnection()
Get theConnection
data were read from.- Specified by:
getConnection
in interfaceResult
- Returns:
- the
Connection
data were read from.
-
getMessage
public final K getMessage()
Get the message, which was read.- Returns:
- the message, which was read.
-
setMessage
public final void setMessage(K message)
Set the message, which was read.- Parameters:
message
- the message, which was read.
-
getSrcAddress
public final L getSrcAddress()
Get the source address, the message was read from.- Returns:
- the source address, the message was read from.
-
getSrcAddressHolder
public final Holder<L> getSrcAddressHolder()
Get the source address, the message was read from.- Returns:
- the source address, the message was read from.
-
setSrcAddress
public final void setSrcAddress(L srcAddress)
Set the source address, the message was read from.- Parameters:
srcAddress
- the source address, the message was read from.
-
setSrcAddressHolder
public final void setSrcAddressHolder(Holder<L> srcAddressHolder)
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
protected void set(Connection<L> connection, K message, L srcAddress, int readSize)
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()
-
-