|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mina.common.support.DelegatedIoConnector
public class DelegatedIoConnector
A delegated IoConnector
that wraps the other IoConnector
.
Field Summary | |
---|---|
protected IoConnector |
delegate
|
Constructor Summary | |
---|---|
protected |
DelegatedIoConnector()
Creates a new instance. |
Method Summary | |
---|---|
void |
addListener(IoServiceListener listener)
Adds an IoServiceListener that listens any events related with
this service. |
ConnectFuture |
connect(java.net.SocketAddress address,
IoHandler handler)
Connects to the specified address . |
ConnectFuture |
connect(java.net.SocketAddress address,
IoHandler handler,
IoServiceConfig config)
Connects to the specified address . |
ConnectFuture |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
IoHandler handler)
Connects to the specified address . |
ConnectFuture |
connect(java.net.SocketAddress address,
java.net.SocketAddress localAddress,
IoHandler handler,
IoServiceConfig config)
Connects to the specified address . |
IoServiceConfig |
getDefaultConfig()
Returns the default configuration which is used when you didn't specify any configuration. |
DefaultIoFilterChainBuilder |
getFilterChain()
A shortcut for ( ( DefaultIoFilterChainBuilder ) IoService.getFilterChainBuilder() ). |
IoFilterChainBuilder |
getFilterChainBuilder()
Returns the global IoFilterChainBuilder which will modify the
IoFilterChain of all IoSession s which is managed
by this service. |
java.util.Set<java.net.SocketAddress> |
getManagedServiceAddresses()
Returns all SocketAddress es this service is managing. |
java.util.Set<IoSession> |
getManagedSessions(java.net.SocketAddress serviceAddress)
Returns all sessions with the specified remote or local address, which are currently managed by this service. |
protected void |
init(IoConnector delegate)
Sets the delegate. |
boolean |
isManaged(java.net.SocketAddress serviceAddress)
Returns true if this service is managing the specified serviceAddress. |
void |
removeListener(IoServiceListener listener)
Removed an existing IoServiceListener that listens any events
related with this service. |
void |
setFilterChainBuilder(IoFilterChainBuilder builder)
Sets the global IoFilterChainBuilder which will modify the
IoFilterChain of all IoSession s which is managed
by this service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected IoConnector delegate
Constructor Detail |
---|
protected DelegatedIoConnector()
Method Detail |
---|
protected void init(IoConnector delegate)
public ConnectFuture connect(java.net.SocketAddress address, IoHandler handler)
IoConnector
address
. If communication starts
successfully, events are fired to the specified
handler
.
connect
in interface IoConnector
ConnectFuture
that will tell the result of the connection attemptpublic ConnectFuture connect(java.net.SocketAddress address, IoHandler handler, IoServiceConfig config)
IoConnector
address
. If communication starts
successfully, events are fired to the specified
handler
.
connect
in interface IoConnector
config
- the configuration
ConnectFuture
that will tell the result of the connection attemptpublic ConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler)
IoConnector
address
. If communication starts
successfully, events are fired to the specified
handler
.
connect
in interface IoConnector
localAddress
- the local address the channel is bound to
ConnectFuture
that will tell the result of the connection attemptpublic ConnectFuture connect(java.net.SocketAddress address, java.net.SocketAddress localAddress, IoHandler handler, IoServiceConfig config)
IoConnector
address
. If communication starts
successfully, events are fired to the specified
handler
.
connect
in interface IoConnector
config
- the configuration
ConnectFuture
that will tell the result of the connection attemptpublic boolean isManaged(java.net.SocketAddress serviceAddress)
IoService
IoAcceptor
, serviceAddress is a bind address.
If this service is an IoConnector
, serviceAddress is a remote address.
isManaged
in interface IoService
public java.util.Set<java.net.SocketAddress> getManagedServiceAddresses()
IoService
SocketAddress
es this service is managing.
If this service is an IoAcceptor
, a set of bind addresses will
be returned. If this service is an IoConnector
, a set of remote
addresses will be returned.
getManagedServiceAddresses
in interface IoService
public java.util.Set<IoSession> getManagedSessions(java.net.SocketAddress serviceAddress)
IoService
IoAcceptor
will assume the specified address is a local
address, and IoConnector
will assume it's a remote address.
getManagedSessions
in interface IoService
serviceAddress
- the address to return all sessions for.
public IoServiceConfig getDefaultConfig()
IoService
getDefaultConfig
in interface IoService
public IoFilterChainBuilder getFilterChainBuilder()
IoService
IoFilterChainBuilder
which will modify the
IoFilterChain
of all IoSession
s which is managed
by this service.
The default value is an empty DefaultIoFilterChainBuilder
.
getFilterChainBuilder
in interface IoService
public void setFilterChainBuilder(IoFilterChainBuilder builder)
IoService
IoFilterChainBuilder
which will modify the
IoFilterChain
of all IoSession
s which is managed
by this service.
If you specify null this property will be set to
an empty DefaultIoFilterChainBuilder
.
setFilterChainBuilder
in interface IoService
public DefaultIoFilterChainBuilder getFilterChain()
IoService
IoService.getFilterChainBuilder()
).
Please note that the returned object is not a real IoFilterChain
but a DefaultIoFilterChainBuilder
. Modifying the returned builder
won't affect the existing IoSession
s at all, because
IoFilterChainBuilder
s affect only newly created IoSession
s.
getFilterChain
in interface IoService
public void addListener(IoServiceListener listener)
IoService
IoServiceListener
that listens any events related with
this service.
addListener
in interface IoService
public void removeListener(IoServiceListener listener)
IoService
IoServiceListener
that listens any events
related with this service.
removeListener
in interface IoService
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |