Class IoFilterMapping
- java.lang.Object
-
- org.apache.mina.integration.spring.IoFilterMapping
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class IoFilterMapping extends java.lang.Object implements org.springframework.beans.factory.InitializingBeanAssociates a name with anIoFilter. This makes it possible to configure named filters using Spring.Use this class when you want to configure the filters added to the filter chain of all sessions created from a particular
IoServicecreated using one of theIoAcceptorFactoryBeansub-classes but you don't want the names to be generated automatically.This class can also be used when creating
Bindingobjects. This lets one configure per-port filters. These filters will only be added to the filter chain of sessions for incoming connections on the port specified by theBinding. Note thatBindingcan also be configured to generate filter names automatically. In that case you add theIoFilterinstances directly to theBinding.- See Also:
IoAcceptorFactoryBean,Binding
-
-
Constructor Summary
Constructors Constructor Description IoFilterMapping()Creates a new empty instance.IoFilterMapping(java.lang.String name, org.apache.mina.common.IoFilter filter)Creates a new instance using the specified name and filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.apache.mina.common.IoFiltergetFilter()Returns the filter of this mapping.java.lang.StringgetName()Returns the name associated with the filter.voidsetFilter(org.apache.mina.common.IoFilter filter)Sets the filter of this mapping.voidsetName(java.lang.String name)Sets the name associated with the filter.
-
-
-
Constructor Detail
-
IoFilterMapping
public IoFilterMapping()
Creates a new empty instance.
-
IoFilterMapping
public IoFilterMapping(java.lang.String name, org.apache.mina.common.IoFilter filter)Creates a new instance using the specified name and filter.- Parameters:
name- the name.filter- the filter.- Throws:
java.lang.IllegalArgumentException- if any of the arguments arenull.
-
-
Method Detail
-
getFilter
public org.apache.mina.common.IoFilter getFilter()
Returns the filter of this mapping.- Returns:
- the filter.
-
getName
public java.lang.String getName()
Returns the name associated with the filter.- Returns:
- the name.
-
setFilter
public void setFilter(org.apache.mina.common.IoFilter filter)
Sets the filter of this mapping.- Parameters:
filter- the filter.- Throws:
java.lang.IllegalArgumentException- if the specified value isnull.
-
setName
public void setName(java.lang.String name)
Sets the name associated with the filter.- Parameters:
name- the name.- Throws:
java.lang.IllegalArgumentException- if the specified value isnull.
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
-