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

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

public static class Response.ResponseAttachment<A>
extends SelectionKeyAttachment
implements Runnable


Field Summary
 
Fields inherited from class com.sun.grizzly.util.SelectionKeyAttachment
DEREGISTERED, timeout, UNLIMITED_TIMEOUT
 
Constructor Summary
Response.ResponseAttachment(long idletimeoutdelay, A attachment, CompletionHandler<? super A> completionHandler, Response response)
           
 
Method Summary
 A getAttachment()
           
 CompletionHandler<? super A> getCompletionHandler()
           
 long getIdleTimeoutDelay()
          returns the idle timeout delay.
 void invokeCompletionHandler()
           
 void resetTimeout()
           
 void resume()
           
 void run()
           
 void setIdleTimeoutDelay(long idletimeoutdelay)
          Subclass need to override this method for it to work.
 boolean timedOut(SelectionKey key)
          called when idle timeout detected.
 void timeout(boolean forceClose)
           
 
Methods inherited from class com.sun.grizzly.util.SelectionKeyAttachment
getAttachment, getTimeout, release, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Response.ResponseAttachment

public 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()

getIdleTimeoutDelay

public long getIdleTimeoutDelay()
Description copied from class: SelectionKeyAttachment
returns the idle timeout delay. default it returns Long.MIN_VALUE , meaning null. -1 means no timeout. Subclass need to override it.

Overrides:
getIdleTimeoutDelay in class SelectionKeyAttachment
Returns:

setIdleTimeoutDelay

public void setIdleTimeoutDelay(long idletimeoutdelay)
Description copied from class: SelectionKeyAttachment
Subclass need to override this method for it to work. Long.MIN_VALUE means null , and default value will be used. -1 means no timeout.

Overrides:
setIdleTimeoutDelay in class SelectionKeyAttachment

invokeCompletionHandler

public void invokeCompletionHandler()

resume

public void resume()

timedOut

public boolean timedOut(SelectionKey key)
Description copied from class: SelectionKeyAttachment
called when idle timeout detected. return true if key should be canceled.

Overrides:
timedOut in class SelectionKeyAttachment
Returns:

run

public void run()
Specified by:
run in interface Runnable

timeout

public void timeout(boolean forceClose)


Copyright © 2009 SUN Microsystems. All Rights Reserved.