org.apache.mina.common
Class DefaultIoFilterChainBuilder
java.lang.Object
org.apache.mina.common.DefaultIoFilterChainBuilder
- All Implemented Interfaces:
- java.lang.Cloneable, IoFilterChainBuilder
public class DefaultIoFilterChainBuilder
- extends java.lang.Object
- implements IoFilterChainBuilder, java.lang.Cloneable
The default implementation of IoFilterChainBuilder
which is useful
in most cases. DefaultIoFilterChainBuilder
has an identical interface
with IoFilter
; it contains a list of IoFilter
s that you can
modify. The IoFilter
s 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 IoFilter
s at all, and the
existing IoSession
s won't get affected by the changes in this builder.
IoFilterChainBuilder
s affect only newly created IoSession
s.
IoAcceptor acceptor = ...;
DefaultIoFilterChainBuilder builder = acceptor.getFilterChain();
builder.addLast( "myFilter", new MyFilter() );
...
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DefaultIoFilterChainBuilder
public DefaultIoFilterChainBuilder()
- Creates a new instance with an empty filter list.
getEntry
public IoFilterChain.Entry getEntry(java.lang.String name)
- See Also:
IoFilterChain.getEntry(String)
get
public IoFilter get(java.lang.String name)
- See Also:
IoFilterChain.get(String)
getAll
public java.util.List<IoFilterChain.Entry> getAll()
- See Also:
IoFilterChain.getAll()
getAllReversed
public java.util.List<IoFilterChain.Entry> getAllReversed()
- See Also:
IoFilterChain.getAllReversed()
contains
public boolean contains(java.lang.String name)
- See Also:
IoFilterChain.contains(String)
contains
public boolean contains(IoFilter filter)
- See Also:
IoFilterChain.contains(IoFilter)
contains
public boolean contains(java.lang.Class<? extends IoFilter> filterType)
- See Also:
IoFilterChain.contains(Class)
addFirst
public void addFirst(java.lang.String name,
IoFilter filter)
- See Also:
IoFilterChain.addFirst(String, IoFilter)
addLast
public void addLast(java.lang.String name,
IoFilter filter)
- See Also:
IoFilterChain.addLast(String, IoFilter)
addBefore
public void addBefore(java.lang.String baseName,
java.lang.String name,
IoFilter filter)
- See Also:
IoFilterChain.addBefore(String, String, IoFilter)
addAfter
public void addAfter(java.lang.String baseName,
java.lang.String name,
IoFilter filter)
- See Also:
IoFilterChain.addAfter(String, String, IoFilter)
remove
public IoFilter remove(java.lang.String name)
- See Also:
IoFilterChain.remove(String)
clear
public void clear()
throws java.lang.Exception
- Throws:
java.lang.Exception
- See Also:
IoFilterChain.clear()
buildFilterChain
public void buildFilterChain(IoFilterChain chain)
throws java.lang.Exception
- Description copied from interface:
IoFilterChainBuilder
- Modifies the specified chain.
- Specified by:
buildFilterChain
in interface IoFilterChainBuilder
- Throws:
java.lang.Exception
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
clone
public java.lang.Object clone()
- Overrides:
clone
in class java.lang.Object