org.glassfish.grizzly.utils
Class IdleTimeoutFilter

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.utils.IdleTimeoutFilter
All Implemented Interfaces:
Filter

public class IdleTimeoutFilter
extends BaseFilter

Author:
oleksiys

Field Summary
static Long FOREVER
           
static Long FOREVER_SPECIAL
           
static String IDLE_ATTRIBUTE_NAME
           
 
Constructor Summary
protected IdleTimeoutFilter(DelayedExecutor executor, boolean needStartExecutor, long timeout, TimeUnit timeunit)
           
  IdleTimeoutFilter(DelayedExecutor executor, long timeout, TimeUnit timeunit)
           
  IdleTimeoutFilter(long timeout, TimeUnit timeunit)
           
 
Method Summary
protected  void finalize()
           
 long getTimeout(TimeUnit timeunit)
           
 NextAction handleAccept(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when server channel has accepted the client connection.
 NextAction handleClose(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when connection has been closed.
 NextAction handleConnect(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when channel gets connected.
 NextAction handleRead(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when channel will become available for reading.
 NextAction handleWrite(FilterChainContext ctx)
          Execute a unit of processing work to be performed, when some data should be written on channel.
protected  void queueAction(FilterChainContext ctx)
           
 
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, getFilterChain, getIndex, handleEvent, onAdded, onFilterChainChanged, onRemoved
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOREVER

public static final Long FOREVER

FOREVER_SPECIAL

public static final Long FOREVER_SPECIAL

IDLE_ATTRIBUTE_NAME

public static final String IDLE_ATTRIBUTE_NAME
See Also:
Constant Field Values
Constructor Detail

IdleTimeoutFilter

public IdleTimeoutFilter(long timeout,
                         TimeUnit timeunit)

IdleTimeoutFilter

public IdleTimeoutFilter(DelayedExecutor executor,
                         long timeout,
                         TimeUnit timeunit)

IdleTimeoutFilter

protected IdleTimeoutFilter(DelayedExecutor executor,
                            boolean needStartExecutor,
                            long timeout,
                            TimeUnit timeunit)
Method Detail

getTimeout

public long getTimeout(TimeUnit timeunit)

handleAccept

public NextAction handleAccept(FilterChainContext ctx)
                        throws IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when server channel has accepted the client connection. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleAccept in interface Filter
Overrides:
handleAccept in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
IOException

handleConnect

public NextAction handleConnect(FilterChainContext ctx)
                         throws IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when channel gets connected. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleConnect in interface Filter
Overrides:
handleConnect in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
IOException

handleRead

public NextAction handleRead(FilterChainContext ctx)
                      throws IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when channel will become available for reading. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleRead in interface Filter
Overrides:
handleRead in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
IOException

handleWrite

public NextAction handleWrite(FilterChainContext ctx)
                       throws IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when some data should be written on channel. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleWrite in interface Filter
Overrides:
handleWrite in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
IOException

handleClose

public NextAction handleClose(FilterChainContext ctx)
                       throws IOException
Description copied from class: BaseFilter
Execute a unit of processing work to be performed, when connection has been closed. This Filter may either complete the required processing and return false, or delegate remaining processing to the next Filter in a FilterChain containing this Filter by returning true.

Specified by:
handleClose in interface Filter
Overrides:
handleClose in class BaseFilter
Parameters:
ctx - FilterChainContext
Returns:
NextAction instruction for FilterChain, how it should continue the execution
Throws:
IOException

queueAction

protected void queueAction(FilterChainContext ctx)

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable


Copyright © 2011 Oracle Corpration. All Rights Reserved.