public abstract class BaseIoService extends java.lang.Object implements IoService
IoService
s.限定符 | 构造器和说明 |
---|---|
protected |
BaseIoService() |
限定符和类型 | 方法和说明 |
---|---|
void |
addListener(IoServiceListener listener)
Adds an
IoServiceListener that listens any events related with
this service. |
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. |
protected IoServiceListenerSupport |
getListeners() |
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.
|
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultConfig
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
在接口中 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
在接口中 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
在接口中 IoService
public void addListener(IoServiceListener listener)
IoService
IoServiceListener
that listens any events related with
this service.addListener
在接口中 IoService
public void removeListener(IoServiceListener listener)
IoService
IoServiceListener
that listens any events
related with this service.removeListener
在接口中 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
在接口中 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
在接口中 IoService
serviceAddress
- the address to return all sessions for.public boolean isManaged(java.net.SocketAddress serviceAddress)
IoService
IoAcceptor
, serviceAddress is a bind address.
If this service is an IoConnector
, serviceAddress is a remote address.protected IoServiceListenerSupport getListeners()