public class DefaultIoFilterChainBuilder extends Object implements IoFilterChainBuilder, Cloneable
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() ); ...
NOOP| Constructor and Description |
|---|
DefaultIoFilterChainBuilder()
Creates a new instance with an empty filter list.
|
| Modifier and Type | Method and Description |
|---|---|
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() |
Object |
clone() |
boolean |
contains(Class<? extends IoFilter> filterType) |
boolean |
contains(IoFilter filter) |
boolean |
contains(String name) |
IoFilter |
get(String name) |
List<IoFilterChain.Entry> |
getAll() |
List<IoFilterChain.Entry> |
getAllReversed() |
IoFilterChain.Entry |
getEntry(String name) |
IoFilter |
remove(String name) |
String |
toString() |
public DefaultIoFilterChainBuilder()
public IoFilterChain.Entry getEntry(String name)
IoFilterChain.getEntry(String)public IoFilter get(String name)
IoFilterChain.get(String)public List<IoFilterChain.Entry> getAll()
IoFilterChain.getAll()public List<IoFilterChain.Entry> getAllReversed()
IoFilterChain.getAllReversed()public boolean contains(String name)
IoFilterChain.contains(String)public boolean contains(IoFilter filter)
IoFilterChain.contains(IoFilter)public boolean contains(Class<? extends IoFilter> filterType)
IoFilterChain.contains(Class)public void addFirst(String name, IoFilter filter)
IoFilterChain.addFirst(String, IoFilter)public void addLast(String name, IoFilter filter)
IoFilterChain.addLast(String, IoFilter)public IoFilter remove(String name)
IoFilterChain.remove(String)public void clear()
throws Exception
ExceptionIoFilterChain.clear()public void buildFilterChain(IoFilterChain chain) throws Exception
IoFilterChainBuilderbuildFilterChain in interface IoFilterChainBuilderExceptionCopyright © 2004–2018 Apache MINA Project. All rights reserved.