org.glassfish.grizzly
Class WriteResult<K,L>

java.lang.Object
  extended by org.glassfish.grizzly.WriteResult<K,L>
All Implemented Interfaces:
Cacheable, Result

public final class WriteResult<K,L>
extends java.lang.Object
implements Result, Cacheable

Result of write operation, returned by Writable.

Author:
Alexey Stashok

Method Summary
static
<K,L> WriteResult<K,L>
create(Connection connection)
           
static
<K,L> WriteResult<K,L>
create(Connection connection, K message, L dstAddress, int writeSize)
           
 Connection getConnection()
          Get the Connection data were read from.
 L getDstAddress()
          Get the destination address, the message was written to.
 K getMessage()
          Get the message, which was read.
 long getWrittenSize()
          Get the number of bytes, which were written.
 void recycle()
           
 void setDstAddress(L dstAddress)
          Set the destination address, the message was written to.
 void setMessage(K message)
          Set the message, which was read.
 void setWrittenSize(long writeSize)
          Set the number of bytes, which were written.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static <K,L> WriteResult<K,L> create(Connection connection)

create

public static <K,L> WriteResult<K,L> create(Connection connection,
                                            K message,
                                            L dstAddress,
                                            int writeSize)

getConnection

public final Connection getConnection()
Get the Connection data were read from.

Specified by:
getConnection in interface Result
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.

getDstAddress

public final L getDstAddress()
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.

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.

recycle

public void recycle()
Specified by:
recycle in interface Cacheable


Copyright © 2012 Oracle Corporation. All Rights Reserved.