Class Binding
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
IoHandler
binding.
This is used when specifying the addresses to accept new connections on when
creating IoAcceptor
objects using
IoAcceptorFactoryBean
.
Note that the address
property is of SocketAddress
type. Use InetSocketAddressEditor
or VmPipeAddressEditor
in
your Spring configuration file to simply the creation of
SocketAddress
instances using Spring.
This class also allows for an optional service configuration using
setServiceConfig(IoServiceConfig)
to be specified. If the binding
specifies an IoServiceConfig
IoAcceptorFactoryBean
will
use IoAcceptor.bind(SocketAddress, IoHandler, IoServiceConfig)
instead
of IoAcceptor.bind(SocketAddress, IoHandler)
when binding. The
IoServiceConfig
object lets you specify transport specific
confiuration options and define port specific filters. This makes it possible
to specify different filters depending on the port the client is connecting
on (e.g. using an
invalid reference
org.apache.mina.filter.SSLFilter
-
Constructor Summary
ConstructorsConstructorDescriptionBinding()
Creates a new empty instance.Binding
(SocketAddress address, org.apache.mina.common.IoHandler handler) Creates a new instance using the specified values.Binding
(SocketAddress address, org.apache.mina.common.IoHandler handler, org.apache.mina.common.IoServiceConfig serviceConfig) Creates a new instance using the specified values. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Returns the address the handler of this object will be bound to.org.apache.mina.common.IoHandler
Returns the handler of this binding object.org.apache.mina.common.IoServiceConfig
void
setAddress
(SocketAddress address) Sets the address the handler of this object will be bound to.void
setHandler
(org.apache.mina.common.IoHandler handler) Sets the handler of this binding object.void
setServiceConfig
(org.apache.mina.common.IoServiceConfig serviceConfig)
-
Constructor Details
-
Binding
public Binding()Creates a new empty instance. -
Binding
Creates a new instance using the specified values.- Parameters:
address
- the address.handler
- the handler.- Throws:
IllegalArgumentException
- if the any of the specified values arenull
.
-
Binding
public Binding(SocketAddress address, org.apache.mina.common.IoHandler handler, org.apache.mina.common.IoServiceConfig serviceConfig) Creates a new instance using the specified values.- Parameters:
address
- the address.handler
- the handler.serviceConfig
- the service configuration.- Throws:
IllegalArgumentException
- if the any of the specified values arenull
.
-
-
Method Details
-
getAddress
Returns the address the handler of this object will be bound to.- Returns:
- the address.
-
setAddress
Sets the address the handler of this object will be bound to.- Parameters:
address
- the address.- Throws:
IllegalArgumentException
- if the specified value isnull
.
-
getHandler
public org.apache.mina.common.IoHandler getHandler()Returns the handler of this binding object.- Returns:
- the handler.
-
setHandler
public void setHandler(org.apache.mina.common.IoHandler handler) Sets the handler of this binding object.- Parameters:
handler
- the handler.- Throws:
IllegalArgumentException
- if the specified value isnull
.
-
getServiceConfig
public org.apache.mina.common.IoServiceConfig getServiceConfig() -
setServiceConfig
public void setServiceConfig(org.apache.mina.common.IoServiceConfig serviceConfig) -
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-