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
public class WriteResult<K,L> extends Object implements Result, Cacheable
Result of write operation, returned byWriteable.- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedWriteResult()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcopy()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)protected Holder<L>createAddrHolder(L dstAddress)Create an address holder.Connection<L>getConnection()Get theConnectiondata were read from.LgetDstAddress()Get the destination address, the message was written to.Holder<L>getDstAddressHolder()Get the destination address, the message was written to.KgetMessage()Get the message, which was read.longgetWrittenSize()Get 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.voidsetDstAddress(L dstAddress)Set the destination address, the message was written to.voidsetDstAddressHolder(Holder<L> dstAddressHolder)Set the destination address, the message was written to.voidsetMessage(K message)Set the message, which was read.voidsetWrittenSize(long writeSize)Set the number of bytes, which were written.
-
-
-
Method Detail
-
create
public static <K,L> WriteResult<K,L> create(Connection<L> connection)
-
create
public static <K,L> WriteResult<K,L> create(Connection<L> connection, K message, L dstAddress, long writeSize)
-
getConnection
public final Connection<L> getConnection()
Get theConnectiondata were read from.- Specified by:
getConnectionin interfaceResult- Returns:
- the
Connectiondata 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.
-
getDstAddress
public final L getDstAddress()
Get the destination address, the message was written to.- Returns:
- the destination address, the message was written to.
-
getDstAddressHolder
public final Holder<L> getDstAddressHolder()
Get the destination address, the message was written to.- Returns:
- the destination address, the message was written to.
-
setDstAddress
public final void setDstAddress(L dstAddress)
Set the destination address, the message was written to.- Parameters:
dstAddress- the destination address, the message was written to.
-
setDstAddressHolder
public final void setDstAddressHolder(Holder<L> dstAddressHolder)
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
protected void set(Connection<L> connection, K message, L dstAddress, long writtenSize)
One method to set all the WriteResult properties.- Parameters:
connection-message-dstAddress-writtenSize-
-
createAddrHolder
protected Holder<L> createAddrHolder(L dstAddress)
Create an address holder.- Parameters:
dstAddress-- Returns:
-
reset
protected void reset()
-
-