Package org.glassfish.grizzly.utils
Class DelayFilter
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.BaseFilter
-
- org.glassfish.grizzly.utils.DelayFilter
-
- All Implemented Interfaces:
Filter
public class DelayFilter extends BaseFilter
Filter which pauses protocol chain processing for a certain time.- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Constructor Description DelayFilter(long readTimeoutMillis, long writeTimeoutMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.-
Methods inherited from class org.glassfish.grizzly.filterchain.BaseFilter
createContext, exceptionOccurred, handleAccept, handleClose, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved, toString
-
-
-
-
Method Detail
-
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. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleRead
in interfaceFilter
- Overrides:
handleRead
in classBaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, 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. ThisFilter
may either complete the required processing and return false, or delegate remaining processing to the nextFilter
in aFilterChain
containing thisFilter
by returning true.- Specified by:
handleWrite
in interfaceFilter
- Overrides:
handleWrite
in classBaseFilter
- Parameters:
ctx
-FilterChainContext
- Returns:
NextAction
instruction forFilterChain
, how it should continue the execution- Throws:
IOException
-
-