org.glassfish.grizzly.asyncqueue
Class PushBackContext

java.lang.Object
  extended by org.glassfish.grizzly.asyncqueue.PushBackContext

public abstract class PushBackContext
extends java.lang.Object

Context being passed when Writer refuses to accept passed WritableMessage due to I/O or memory limitations. User may perform one of the actions proposed by the context: 1) cancel() to cancel message writing 2) retryWhenPossible() to ask Grizzly to write the message once it's possible 3) retryNow() to ask Grizzly to try to write message again (not suggested)

Since:
2.2
Author:
Alexey Stashok

Field Summary
protected  AsyncWriteQueueRecord queueRecord
           
 
Constructor Summary
PushBackContext(AsyncWriteQueueRecord queueRecord)
           
 
Method Summary
abstract  void cancel()
          Instructs Grizzly to cancel this message write and release message associated resources.
 PushBackHandler getPushBackHandler()
          The PushBackHandler passed along with one of the Writer's write(...) method call.
abstract  void retryNow()
          Instructs Grizzly to try to resend the message right now.
abstract  void retryWhenPossible()
          Instructs Grizzly to send this message once some resources get released.
 long size()
          Returns the message size.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queueRecord

protected final AsyncWriteQueueRecord queueRecord
Constructor Detail

PushBackContext

public PushBackContext(AsyncWriteQueueRecord queueRecord)
Method Detail

getPushBackHandler

public PushBackHandler getPushBackHandler()
The PushBackHandler passed along with one of the Writer's write(...) method call.

Returns:
PushBackHandler passed along with write(...) call.

size

public final long size()
Returns the message size.

Returns:
the message size.

retryWhenPossible

public abstract void retryWhenPossible()
Instructs Grizzly to send this message once some resources get released.


retryNow

public abstract void retryNow()
Instructs Grizzly to try to resend the message right now.


cancel

public abstract void cancel()
Instructs Grizzly to cancel this message write and release message associated resources.



Copyright © 2012 Oracle Corporation. All Rights Reserved.