Class AbstractCodecFilter<K,L>
- java.lang.Object
-
- org.glassfish.grizzly.filterchain.BaseFilter
-
- org.glassfish.grizzly.filterchain.AbstractCodecFilter<K,L>
-
- All Implemented Interfaces:
Codec<K,L>
,CodecFilter<K,L>
,Filter
- Direct Known Subclasses:
ChunkingFilter
,StringFilter
public abstract class AbstractCodecFilter<K,L> extends BaseFilter implements CodecFilter<K,L>
- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Constructor Description AbstractCodecFilter(Transformer<K,L> decoder, Transformer<L,K> encoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Transformer<K,L>
getDecoder()
Transformer<L,K>
getEncoder()
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.glassfish.grizzly.filterchain.Filter
exceptionOccurred, handleAccept, handleClose, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved
-
-
-
-
Constructor Detail
-
AbstractCodecFilter
public AbstractCodecFilter(Transformer<K,L> decoder, Transformer<L,K> encoder)
-
-
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
-
getDecoder
public Transformer<K,L> getDecoder()
- Specified by:
getDecoder
in interfaceCodec<K,L>
-
getEncoder
public Transformer<L,K> getEncoder()
- Specified by:
getEncoder
in interfaceCodec<K,L>
-
-