org.apache.mina.common
Class DefaultIoFilterChainBuilder

java.lang.Object
  extended by org.apache.mina.common.DefaultIoFilterChainBuilder
All Implemented Interfaces:
IoFilterChainBuilder

public class DefaultIoFilterChainBuilder
extends Object
implements IoFilterChainBuilder

The default implementation of IoFilterChainBuilder which is useful in most cases. DefaultIoFilterChainBuilder has an identical interface with IoFilter; it contains a list of IoFilters that you can modify. The IoFilters which are added to this builder will be appended to the IoFilterChain when buildFilterChain(IoFilterChain) is invoked.

However, the identical interface doesn't mean that it behaves in an exactly same way with IoFilterChain. DefaultIoFilterChainBuilder doesn't manage the life cycle of the IoFilters at all, and the existing IoSessions won't get affected by the changes in this builder. IoFilterChainBuilders affect only newly created IoSessions.

 IoAcceptor acceptor = ...;
 DefaultIoFilterChainBuilder builder = acceptor.getFilterChain();
 builder.addLast( "myFilter", new MyFilter() );
 ...
 

Version:
$Rev: 350135 $, $Date: 2005-12-01 12:43:29 +0900 $
Author:
The Apache Directory Project (dev@directory.apache.org)

Field Summary
 
Fields inherited from interface org.apache.mina.common.IoFilterChainBuilder
NOOP
 
Constructor Summary
DefaultIoFilterChainBuilder()
          Creates a new instance with an empty filter list.
 
Method Summary
 void addAfter(String baseName, String name, IoFilter filter)
           
 void addBefore(String baseName, String name, IoFilter filter)
           
 void addFirst(String name, IoFilter filter)
           
 void addLast(String name, IoFilter filter)
           
 void buildFilterChain(IoFilterChain chain)
          Modifies the specified chain.
 void clear()
           
 boolean contains(Class filterType)
           
 boolean contains(IoFilter filter)
           
 boolean contains(String name)
           
 IoFilter get(String name)
           
 List getAll()
           
 List getAllReversed()
           
 IoFilterChain.Entry getEntry(String name)
           
 IoFilter remove(String name)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultIoFilterChainBuilder

public DefaultIoFilterChainBuilder()
Creates a new instance with an empty filter list.

Method Detail

getEntry

public IoFilterChain.Entry getEntry(String name)
See Also:
IoFilterChain.getEntry(String)

get

public IoFilter get(String name)
See Also:
IoFilterChain.get(String)

getAll

public List getAll()
See Also:
IoFilterChain.getAll()

getAllReversed

public List getAllReversed()
See Also:
IoFilterChain.getAllReversed()

contains

public boolean contains(String name)
See Also:
IoFilterChain.contains(String)

contains

public boolean contains(IoFilter filter)
See Also:
IoFilterChain.contains(IoFilter)

contains

public boolean contains(Class filterType)
See Also:
IoFilterChain.contains(Class)

addFirst

public void addFirst(String name,
                     IoFilter filter)
See Also:
IoFilterChain.addFirst(String, IoFilter)

addLast

public void addLast(String name,
                    IoFilter filter)
See Also:
IoFilterChain.addLast(String, IoFilter)

addBefore

public void addBefore(String baseName,
                      String name,
                      IoFilter filter)
See Also:
IoFilterChain.addBefore(String, String, IoFilter)

addAfter

public void addAfter(String baseName,
                     String name,
                     IoFilter filter)
See Also:
IoFilterChain.addAfter(String, String, IoFilter)

remove

public IoFilter remove(String name)
See Also:
IoFilterChain.remove(String)

clear

public void clear()
           throws Exception
Throws:
Exception
See Also:
IoFilterChain.clear()

buildFilterChain

public void buildFilterChain(IoFilterChain chain)
                      throws Exception
Description copied from interface: IoFilterChainBuilder
Modifies the specified chain.

Specified by:
buildFilterChain in interface IoFilterChainBuilder
Throws:
Exception

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2005 . All Rights Reserved.