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

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

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

Result of read operation, returned by Readable.

Author:
Alexey Stashok

Constructor Summary
protected ReadResult(Connection connection)
           
protected ReadResult(Connection connection, K message, L srcAddress, int readSize)
           
 
Method Summary
static
<K,L> ReadResult<K,L>
create(Connection connection)
           
static
<K,L> ReadResult<K,L>
create(Connection connection, K message, L srcAddress, int readSize)
           
 Connection getConnection()
          Get the Connection 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.
 void recycle()
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadResult

protected ReadResult(Connection connection)

ReadResult

protected ReadResult(Connection connection,
                     K message,
                     L srcAddress,
                     int readSize)
Method Detail

create

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

create

public static <K,L> ReadResult<K,L> create(Connection connection,
                                           K message,
                                           L srcAddress,
                                           int readSize)

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.

getSrcAddress

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

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.

recycle

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


Copyright © 2012 Oracle Corporation. All Rights Reserved.