Top Description Inners Fields Constructors Methods
org.glassfish.grizzly.utils

public final Class SilentConnectionFilter

extends BaseFilter
Class Inheritance
Imports
java.io.IOException, java.util.concurrent.TimeUnit, java.util.logging.Logger, org.glassfish.grizzly.Connection, .Grizzly, org.glassfish.grizzly.attributes.Attribute, org.glassfish.grizzly.filterchain.BaseFilter, .FilterChainContext, .NextAction

Filter, which determines silent connections and closes them. The silent connection is a connection, which didn't send/receive any byte since it was accepted during specified period of time.
Author
Alexey Stashok

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private static final String
private static final Logger
private final DelayedExecutor.DelayQueue<Connection<L>>
private static final Attribute<Long>
private final long
public static final long
public static final long

Constructor Summary

AccessConstructor and Description
public
SilentConnectionFilter(DelayedExecutor executor, long timeout, TimeUnit timeunit)

Method Summary

Modifier and TypeMethod and Description
public long
getTimeout(TimeUnit timeunit)

public NextAction
handleAccept(FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleAccept.

Implements org.glassfish.grizzly.filterchain.Filter.handleAccept.

Execute a unit of processing work to be performed, when server channel has accepted the client connection.

public NextAction
handleClose(FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleClose.

Implements org.glassfish.grizzly.filterchain.Filter.handleClose.

Execute a unit of processing work to be performed, when connection has been closed.

public NextAction
handleRead(FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

Implements org.glassfish.grizzly.filterchain.Filter.handleRead.

Execute a unit of processing work to be performed, when channel will become available for reading.

public NextAction
handleWrite(FilterChainContext ctx)

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

Implements org.glassfish.grizzly.filterchain.Filter.handleWrite.

Execute a unit of processing work to be performed, when some data should be written on channel.

Inherited from org.glassfish.grizzly.filterchain.BaseFilter:
createContextexceptionOccurredhandleConnecthandleEventonAddedonFilterChainChangedonRemovedtoString

Field Detail

ATTR_NAMEback to summary
private static final String ATTR_NAME
LOGGERback to summary
private static final Logger LOGGER
queueback to summary
private final DelayedExecutor.DelayQueue<Connection<L>> queue
silentConnectionAttrback to summary
private static final Attribute<Long> silentConnectionAttr
timeoutMillisback to summary
private final long timeoutMillis
UNLIMITED_TIMEOUTback to summary
public static final long UNLIMITED_TIMEOUT
UNSET_TIMEOUTback to summary
public static final long UNSET_TIMEOUT

Constructor Detail

SilentConnectionFilterback to summary
public SilentConnectionFilter(DelayedExecutor executor, long timeout, TimeUnit timeunit)

Method Detail

getTimeoutback to summary
public long getTimeout(TimeUnit timeunit)
handleAcceptback to summary
public NextAction handleAccept(FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleAccept.

Implements org.glassfish.grizzly.filterchain.Filter.handleAccept.

Doc from org.glassfish.grizzly.filterchain.BaseFilter.handleAccept.

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.

Annotations
@Override
handleCloseback to summary
public NextAction handleClose(FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleClose.

Implements org.glassfish.grizzly.filterchain.Filter.handleClose.

Doc from org.glassfish.grizzly.filterchain.BaseFilter.handleClose.

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.

Annotations
@Override
handleReadback to summary
public NextAction handleRead(FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

Implements org.glassfish.grizzly.filterchain.Filter.handleRead.

Doc from org.glassfish.grizzly.filterchain.BaseFilter.handleRead.

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.

Annotations
@Override
handleWriteback to summary
public NextAction handleWrite(FilterChainContext ctx) throws IOException

Overrides org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

Implements org.glassfish.grizzly.filterchain.Filter.handleWrite.

Doc from org.glassfish.grizzly.filterchain.BaseFilter.handleWrite.

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.

Annotations
@Override
org.glassfish.grizzly.utils back to summary

private final Class SilentConnectionFilter.Resolver

extends Object
implements DelayedExecutor.Resolver<Connection<L>>
Class Inheritance
All Implemented Interfaces
org.glassfish.grizzly.utils.DelayedExecutor.Resolver

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public long
public boolean
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Resolverback to summary
private Resolver()

Method Detail

getTimeoutMillisback to summary
public long getTimeoutMillis(Connection<L> connection)

Implements org.glassfish.grizzly.utils.DelayedExecutor.Resolver.getTimeoutMillis.

Annotations
@Override
removeTimeoutback to summary
public boolean removeTimeout(Connection<L> connection)

Implements org.glassfish.grizzly.utils.DelayedExecutor.Resolver.removeTimeout.

Annotations
@Override
setTimeoutMillisback to summary
public void setTimeoutMillis(Connection<L> connection, long timeoutMillis)

Implements org.glassfish.grizzly.utils.DelayedExecutor.Resolver.setTimeoutMillis.

Annotations
@Override