org.glassfish.grizzly.filterchain
Class AbstractCodecFilter<K,L>

java.lang.Object
  extended by org.glassfish.grizzly.filterchain.BaseFilter
      extended by org.glassfish.grizzly.filterchain.AbstractCodecFilter<K,L>
All Implemented Interfaces:
Codec<K,L>, CodecFilter<K,L>, Filter
Direct Known Subclasses:
ChunkingFilter, SSLFilter, StringFilter

public abstract class AbstractCodecFilter<K,L>
extends BaseFilter
implements CodecFilter<K,L>

Author:
Alexey Stashok

Constructor Summary
AbstractCodecFilter(Transformer<K,L> decoder, Transformer<L,K> encoder)
           
 
Method Summary
 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, getFilterChain, getIndex, handleAccept, handleClose, handleConnect, handleEvent, onAdded, onFilterChainChanged, onRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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 java.io.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:
java.io.IOException

handleWrite

public NextAction handleWrite(FilterChainContext ctx)
                       throws java.io.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:
java.io.IOException

getDecoder

public Transformer<K,L> getDecoder()
Specified by:
getDecoder in interface Codec<K,L>

getEncoder

public Transformer<L,K> getEncoder()
Specified by:
getEncoder in interface Codec<K,L>


Copyright © 2012 Oracle Corporation. All Rights Reserved.