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
Constructors -
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 theConnectiondata were read from.final LGet the destination address, the message was written to.Get the destination address, the message was written to.final KGet the message, which was read.final longGet the number of bytes, which were written.voidrecycle()protected voidreset()protected voidset(Connection<L> connection, K message, L dstAddress, long writtenSize) One method to set all the WriteResult properties.final voidsetDstAddress(L dstAddress) Set the destination address, the message was written to.final voidsetDstAddressHolder(Holder<L> dstAddressHolder) Set the destination address, the message was written to.final voidsetMessage(K message) Set the message, which was read.final voidsetWrittenSize(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 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.
-
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
-