com.sun.grizzly.suspendable
Class SuspendableMonitor

java.lang.Object
  extended by com.sun.grizzly.suspendable.SuspendableMonitor
All Implemented Interfaces:
Runnable

public class SuspendableMonitor
extends Object
implements Runnable

A secondary Selector used to keep the state of a suspended connection (SelectionKey). See SuspendableFilter for more info. TODO: Add Pipelining/Multiplexing support.

Author:
Jeanfrancois Arcand

Constructor Summary
SuspendableMonitor()
          Start a new Thread with a Selector running.
 
Method Summary
protected  void expireIdleKeys()
          Expire the SelectionKey?
protected  void interrupted(SelectionKey key)
          Interrupt a suspended SelectionKey that have timed out.
 void run()
           
protected  void suspend(SuspendableFilter.KeyHandler kh)
          Suspend the ReadableChannel represented by this SuspendableFilter.KeyHandler by registering it on secondary Selector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SuspendableMonitor

public SuspendableMonitor()
Start a new Thread with a Selector running.

Method Detail

run

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

expireIdleKeys

protected void expireIdleKeys()
Expire the SelectionKey?


interrupted

protected void interrupted(SelectionKey key)
Interrupt a suspended SelectionKey that have timed out.


suspend

protected void suspend(SuspendableFilter.KeyHandler kh)
                throws ClosedChannelException
Suspend the ReadableChannel represented by this SuspendableFilter.KeyHandler by registering it on secondary Selector.

Parameters:
kh - The KeyHandler which hold the current SelectionKey.
Throws:
ClosedChannelException


Copyright © 2012 Oracle Corporation. All Rights Reserved.