public class Binding
extends java.lang.Object
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 SSLFilter
when connecting
on port 443 but not on port 80).
构造器和说明 |
---|
Binding()
Creates a new empty instance.
|
Binding(java.net.SocketAddress address,
IoHandler handler)
Creates a new instance using the specified values.
|
Binding(java.net.SocketAddress address,
IoHandler handler,
IoServiceConfig serviceConfig)
Creates a new instance using the specified values.
|
限定符和类型 | 方法和说明 |
---|---|
void |
afterPropertiesSet() |
java.net.SocketAddress |
getAddress()
Returns the address the handler of this object will be bound to.
|
IoHandler |
getHandler()
Returns the handler of this binding object.
|
IoServiceConfig |
getServiceConfig() |
void |
setAddress(java.net.SocketAddress address)
Sets the address the handler of this object will be bound to.
|
void |
setHandler(IoHandler handler)
Sets the handler of this binding object.
|
void |
setServiceConfig(IoServiceConfig serviceConfig) |
public Binding()
public Binding(java.net.SocketAddress address, IoHandler handler)
address
- the address.handler
- the handler.java.lang.IllegalArgumentException
- if the any of the specified values are
null
.public Binding(java.net.SocketAddress address, IoHandler handler, IoServiceConfig serviceConfig)
address
- the address.handler
- the handler.serviceConfig
- the service configuration.java.lang.IllegalArgumentException
- if the any of the specified values are
null
.public java.net.SocketAddress getAddress()
public void setAddress(java.net.SocketAddress address)
address
- the address.java.lang.IllegalArgumentException
- if the specified value is
null
.public IoHandler getHandler()
public void setHandler(IoHandler handler)
handler
- the handler.java.lang.IllegalArgumentException
- if the specified value is
null
.public IoServiceConfig getServiceConfig()
public void setServiceConfig(IoServiceConfig serviceConfig)
public void afterPropertiesSet() throws java.lang.Exception
java.lang.Exception