java.lang.Object
org.glassfish.grizzly.filterchain.BaseFilter
org.glassfish.grizzly.utils.SilentConnectionFilter
- All Implemented Interfaces:
Filter
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
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionSilentConnectionFilter(DelayedExecutor executor, long timeout, TimeUnit timeunit) -
Method Summary
Modifier and TypeMethodDescriptionlonggetTimeout(TimeUnit timeunit) Execute a unit of processing work to be performed, when server channel has accepted the client connection.Execute a unit of processing work to be performed, when connection has been closed.Execute a unit of processing work to be performed, when channel will become available for reading.Execute a unit of processing work to be performed, when some data should be written on channel.Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved, toString
-
Field Details
-
UNLIMITED_TIMEOUT
public static final long UNLIMITED_TIMEOUT- See Also:
-
UNSET_TIMEOUT
public static final long UNSET_TIMEOUT- See Also:
-
-
Constructor Details
-
SilentConnectionFilter
-
-
Method Details
-
getTimeout
-
handleAccept
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when server channel has accepted the client connection. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleAcceptin interfaceFilter- Overrides:
handleAcceptin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleRead
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when channel will become available for reading. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleReadin interfaceFilter- Overrides:
handleReadin classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleWrite
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when some data should be written on channel. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleWritein interfaceFilter- Overrides:
handleWritein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-
handleClose
Description copied from class:BaseFilterExecute a unit of processing work to be performed, when connection has been closed. ThisFiltermay either complete the required processing and return false, or delegate remaining processing to the nextFilterin aFilterChaincontaining thisFilterby returning true.- Specified by:
handleClosein interfaceFilter- Overrides:
handleClosein classBaseFilter- Parameters:
ctx-FilterChainContext- Returns:
NextActioninstruction forFilterChain, how it should continue the execution- Throws:
IOException
-