org.glassfish.grizzly.asyncqueue
Interface PushBackHandler


public interface PushBackHandler

Callback handler, which will be called by Grizzly Writer implementation, if message can not be neither written nor added to write queue at the moment due to I/O or memory limitations. User may perform one of the actions proposed by PushBackContext or implement any other custom processing logic.

Since:
2.2
Author:
Alexey Stashok

Method Summary
 void onAccept(Connection connection, WritableMessage message)
          The method is invoked once message is accepted by Writer.
 void onPushBack(Connection connection, WritableMessage message, PushBackContext pushBackContext)
          The method is invoked if message was refused by Writer due to I/O or memory limitations.
 

Method Detail

onAccept

void onAccept(Connection connection,
              WritableMessage message)
The method is invoked once message is accepted by Writer. It means either message was written or scheduled to be written asynchronously.

Parameters:
connection - Connection
message - WritableMessage

onPushBack

void onPushBack(Connection connection,
                WritableMessage message,
                PushBackContext pushBackContext)
The method is invoked if message was refused by Writer due to I/O or memory limitations. At this point user can perform one of the actions proposed by PushBackContext, or implement any custom processing logic.

Parameters:
connection - Connection
message - WritableMessage
pushBackContext - PushBackContext


Copyright © 2012 Oracle Corporation. All Rights Reserved.