public class DefaultIoFilterChainBuilderFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean
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.
Constructor and Description |
---|
DefaultIoFilterChainBuilderFactoryBean() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
createInstance() |
java.lang.Class |
getObjectType() |
void |
setFilterNamePrefix(java.lang.String prefix)
Sets the prefix used to create the names for automatically named filters
added using
#setFilters(IoFilter[]) . |
void |
setFilters(java.util.List filters)
Sets a number of filters which will be added to the filter
chain created by this factory bean.
|
public DefaultIoFilterChainBuilderFactoryBean()
protected java.lang.Object createInstance() throws java.lang.Exception
createInstance
in class org.springframework.beans.factory.config.AbstractFactoryBean
java.lang.Exception
public java.lang.Class getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean
getObjectType
in class org.springframework.beans.factory.config.AbstractFactoryBean
public void setFilterNamePrefix(java.lang.String prefix)
#setFilters(IoFilter[])
. The default prefix is
filter.prefix
- the prefix.java.lang.IllegalArgumentException
- if the specified value is
null
.public void setFilters(java.util.List filters)
IoFilter
or IoFilterMapping
objects. Filters which
haven't been wrapped in IoFilterMapping
objects will be assigned
automatically generated names (<filterNamePrefix>0
,
<filterNamePrefix>1
, etc).filters
- the list of IoFilter
and/or
IoFilterMapping
objects.java.lang.IllegalArgumentException
- if the specified value is
null
or contains objects of the wrong type.setFilterNamePrefix(String)
Copyright © 2004-2019 Apache MINA Project. All Rights Reserved.