Class DefaultIoFilterChainBuilder

java.lang.Object
org.apache.mina.common.DefaultIoFilterChainBuilder
All Implemented Interfaces:
Cloneable, IoFilterChainBuilder

public class DefaultIoFilterChainBuilder extends Object implements IoFilterChainBuilder, Cloneable
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() );
 ...