com.sun.grizzly.tcp
Class Response.ResponseAttachment<A>
java.lang.Object
com.sun.grizzly.util.SelectionKeyAttachment
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Response.ResponseAttachment
public Response.ResponseAttachment(long idletimeoutdelay,
A attachment,
CompletionHandler<? super A> completionHandler,
Response response)
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.