com.sun.grizzly.tcp
Class Response.ResponseAttachment<A>

java.lang.Object
  extended by com.sun.grizzly.tcp.Response.ResponseAttachment<A>
All Implemented Interfaces:
SelectionKeyAttachment.KeySelectionListener, SelectionKeyAttachment.TimeOutListener
Enclosing class:
Response<A>

public static class Response.ResponseAttachment<A>
extends Object
implements SelectionKeyAttachment.KeySelectionListener, SelectionKeyAttachment.TimeOutListener


Field Summary
protected  ReentrantLock lock
           
protected  ThreadAttachment threadAttachment
           
 
Constructor Summary
protected Response.ResponseAttachment(long idleTimeoutDelay, A attachment, CompletionHandler<? super A> completionHandler, Response response)
           
 
Method Summary
 void cancel()
           
 A getAttachment()
           
 CompletionHandler<? super A> getCompletionHandler()
           
 long getIdleTimeoutDelay()
           
 long getTimeout()
           
 void invokeCompletionHandler()
           
 void onKeySelected(SelectionKey selectionKey)
           
 boolean onTimeOut(SelectionKey key)
           
 void resetTimeout()
           
 void resume()
           
 void setIdleTimeoutDelay(long idleTimeoutDelay)
           
 boolean timeout()
          Method will be called to notify about async HTTP processing timeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lock

protected volatile ReentrantLock lock

threadAttachment

protected volatile ThreadAttachment threadAttachment
Constructor Detail

Response.ResponseAttachment

protected Response.ResponseAttachment(long idleTimeoutDelay,
                                      A attachment,
                                      CompletionHandler<? super A> completionHandler,
                                      Response response)
Method Detail

getAttachment

public A getAttachment()

getCompletionHandler

public CompletionHandler<? super A> getCompletionHandler()

resetTimeout

public void resetTimeout()

getTimeout

public long getTimeout()

getIdleTimeoutDelay

public long getIdleTimeoutDelay()

setIdleTimeoutDelay

public void setIdleTimeoutDelay(long idleTimeoutDelay)

invokeCompletionHandler

public void invokeCompletionHandler()

resume

public void resume()

onTimeOut

public final boolean onTimeOut(SelectionKey key)
Specified by:
onTimeOut in interface SelectionKeyAttachment.TimeOutListener

onKeySelected

public void onKeySelected(SelectionKey selectionKey)
Specified by:
onKeySelected in interface SelectionKeyAttachment.KeySelectionListener

timeout

public boolean timeout()
Method will be called to notify about async HTTP processing timeout

Returns:
true, if async processing has been finished, or false if we should re-register the channel to continue async HTTP request processing

cancel

public void cancel()


Copyright © 2012 Oracle Corporation. All Rights Reserved.