Package org.glassfish.grizzly
Class WriteResult<K,L>
java.lang.Object
org.glassfish.grizzly.WriteResult<K,L>
- Type Parameters:
K
- type of the messageL
- type of the address
- Direct Known Subclasses:
RecordWriteResult
Result of write operation, returned by
Writeable
.- Author:
- Alexey Stashok
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
static <K,
L> WriteResult<K, L> create
(Connection<L> connection) static <K,
L> WriteResult<K, L> create
(Connection<L> connection, K message, L dstAddress, long writeSize) createAddrHolder
(L dstAddress) Create an address holder.final Connection<L>
Get theConnection
data were read from.final L
Get the destination address, the message was written to.Get the destination address, the message was written to.final K
Get the message, which was read.final long
Get the number of bytes, which were written.void
recycle()
protected void
reset()
protected void
set
(Connection<L> connection, K message, L dstAddress, long writtenSize) One method to set all the WriteResult properties.final void
setDstAddress
(L dstAddress) Set the destination address, the message was written to.final void
setDstAddressHolder
(Holder<L> dstAddressHolder) Set the destination address, the message was written to.final void
setMessage
(K message) Set the message, which was read.final void
setWrittenSize
(long writeSize) Set the number of bytes, which were written.
-
Constructor Details
-
WriteResult
protected WriteResult()
-
-
Method Details
-
create
-
create
public static <K,L> WriteResult<K,L> create(Connection<L> connection, K message, L dstAddress, long writeSize) -
getConnection
Get theConnection
data were read from.- Specified by:
getConnection
in interfaceResult
- Returns:
- the
Connection
data 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.
-
getDstAddress
Get the destination address, the message was written to.- Returns:
- the destination address, the message was written to.
-
getDstAddressHolder
Get the destination address, the message was written to.- Returns:
- the destination address, the message was written to.
-
setDstAddress
Set the destination address, the message was written to.- Parameters:
dstAddress
- the destination address, the message was written to.
-
setDstAddressHolder
Set the destination address, the message was written to.- Parameters:
dstAddressHolder
- the destination address, the message was written to.
-
getWrittenSize
public final long getWrittenSize()Get the number of bytes, which were written.- Returns:
- the number of bytes, which were written.
-
setWrittenSize
public final void setWrittenSize(long writeSize) Set the number of bytes, which were written.- Parameters:
writeSize
- the number of bytes, which were written.
-
set
One method to set all the WriteResult properties.- Parameters:
connection
-message
-dstAddress
-writtenSize
-
-
createAddrHolder
Create an address holder.- Parameters:
dstAddress
-- Returns:
-
reset
protected void reset() -
recycle
public void recycle() -
copy
-