org.apache.mina.integration.spring
Class DefaultIoFilterChainBuilderFactoryBean

java.lang.Object
  extended by AbstractFactoryBean
      extended by org.apache.mina.integration.spring.DefaultIoFilterChainBuilderFactoryBean

public class DefaultIoFilterChainBuilderFactoryBean
extends AbstractFactoryBean

Spring FactoryBean which creates DefaultIoFilterChainBuilder instances. This factory bean makes it possible to configure the filters to be added to all the sessions created by an IoAcceptor or IoConnector using Spring.

The filters may be set up in two ways. By creating IoFilterMapping objects which associate a name with an IoFilter instance and set them using setFilterMappings(IoFilterMapping[]) or by using setFilters(IoFilter[]) directly which assigns automatically generated names to each IoFilter. Use the setFilterNamePrefix(String) method to set the prefix used for auto generated names.

Version:
$Rev: 391231 $, $Date: 2006-04-04 15:21:55 +0900 (Tue, 04 Apr 2006) $
Author:
The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
DefaultIoFilterChainBuilderFactoryBean()
           
 
Method Summary
protected  Object createInstance()
           
 Class getObjectType()
           
 void setFilterMappings(IoFilterMapping[] filterMappings)
          Sets a number of named filters which will be added to the filter chain created by this factory bean.
 void setFilterNamePrefix(String prefix)
          Sets the prefix used to create the names for automatically named filters added using setFilters(IoFilter[]).
 void setFilters(IoFilter[] filters)
          Sets a number of unnamed filters which will be added to the filter chain created by this factory bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultIoFilterChainBuilderFactoryBean

public DefaultIoFilterChainBuilderFactoryBean()
Method Detail

createInstance

protected Object createInstance()
                         throws Exception
Throws:
Exception

getObjectType

public Class getObjectType()

setFilterNamePrefix

public void setFilterNamePrefix(String prefix)
Sets the prefix used to create the names for automatically named filters added using setFilters(IoFilter[]). The default prefix is filter.

Parameters:
prefix - the prefix.
Throws:
IllegalArgumentException - if the specified value is null.

setFilters

public void setFilters(IoFilter[] filters)
Sets a number of unnamed filters which will be added to the filter chain created by this factory bean. The filters will be assigned automatically generated names (<filterNamePrefix>0, <filterNamePrefix>1, etc).

Parameters:
filters - the filters.
Throws:
IllegalArgumentException - if the specified value is null.
See Also:
setFilterNamePrefix(String)

setFilterMappings

public void setFilterMappings(IoFilterMapping[] filterMappings)
Sets a number of named filters which will be added to the filter chain created by this factory bean. IoFilterMapping objects set using this method which haven't had their name set will be assigned automatically generated names derived from the prefix set using setFilterNamePrefix(String) and the position in the specified array (i.e. <filterNamePrefix><pos>).

Parameters:
filterMappings - the name to filter mappings.
Throws:
IllegalArgumentException - if the specified value is null.
See Also:
setFilterNamePrefix(String)