com.sun.grizzly.suspendable
Class Suspendable

java.lang.Object
  extended by com.sun.grizzly.suspendable.Suspendable

public class Suspendable
extends Object

An Object representing the result of an suspendable operation like SuspendableFilter@#suspend An instance of that class can be used to resume or cancel a suspended connection. See SuspendableFilter for more information.

Author:
Jeanfrancois Arcand

Constructor Summary
protected Suspendable(SuspendableFilter suspendableFilter)
           
 
Method Summary
 void cancel()
          Cancel a suspended connection.
protected  SelectionKey getKey()
          Return the underlying SelectionKey representing the connection.
 boolean isResumed()
          Return true if the connection associated with this instance has been #resumed
 boolean resume()
          Resume a suspended connection.
protected  void setKey(SelectionKey key)
          Set the underlying SelectionKey.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Suspendable

protected Suspendable(SuspendableFilter suspendableFilter)
Method Detail

resume

public boolean resume()
Resume a suspended connection. If the connection has been resumed, calling resume with produce an IllegalStateException.

Returns:
true is resumed.

isResumed

public boolean isResumed()
Return true if the connection associated with this instance has been #resumed

Returns:
true if resumed.

cancel

public void cancel()
Cancel a suspended connection. If the connection has been #resumed, calling resume with produce an IllegalStateException.


getKey

protected SelectionKey getKey()
Return the underlying SelectionKey representing the connection.

Returns:
the underlying SelectionKey representing the connection.

setKey

protected void setKey(SelectionKey key)
Set the underlying SelectionKey.

Parameters:
key - the underlying SelectionKey.


Copyright © 2011 SUN Microsystems. All Rights Reserved.