|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.littleshoot.mina.common.support.DelegatedIoAcceptor
public class DelegatedIoAcceptor
A delegated IoAcceptor that wraps the other IoAcceptor.
| Field Summary | |
|---|---|
protected IoAcceptor |
delegate
|
| Constructor Summary | |
|---|---|
protected |
DelegatedIoAcceptor()
Creates a new instance. |
| Method Summary | |
|---|---|
void |
addListener(IoServiceListener listener)
Adds an IoServiceListener that listens any events related with
this service. |
void |
bind(SocketAddress address,
IoHandler handler)
Binds to the specified address and handles incoming
connections with the specified handler. |
void |
bind(SocketAddress address,
IoHandler handler,
IoServiceConfig config)
Binds to the specified address and handles incoming
connections with the specified handler. |
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 IoSessions which is managed
by this service. |
Set<SocketAddress> |
getManagedServiceAddresses()
Returns all SocketAddresses this service is managing. |
Set<IoSession> |
getManagedSessions(SocketAddress serviceAddress)
Returns all sessions with the specified remote or local address, which are currently managed by this service. |
protected void |
init(IoAcceptor delegate)
Sets the delegate. |
boolean |
isManaged(SocketAddress address)
Returns true if this service is managing the specified serviceAddress. |
IoSession |
newSession(SocketAddress remoteAddress,
SocketAddress localAddress)
(Optional) Returns an IoSession that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by IoAcceptor
via IoAcceptor.bind(SocketAddress, IoHandler). |
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 IoSessions which is managed
by this service. |
void |
unbind(SocketAddress address)
Unbinds from the specified address and disconnects all clients
connected there. |
void |
unbindAll()
Unbinds all addresses which were bound by this acceptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IoAcceptor delegate
| Constructor Detail |
|---|
protected DelegatedIoAcceptor()
| Method Detail |
|---|
protected void init(IoAcceptor delegate)
public void bind(SocketAddress address,
IoHandler handler)
throws IOException
IoAcceptoraddress and handles incoming
connections with the specified handler.
bind in interface IoAcceptorIOException - if failed to bind
public void bind(SocketAddress address,
IoHandler handler,
IoServiceConfig config)
throws IOException
IoAcceptoraddress and handles incoming
connections with the specified handler.
bind in interface IoAcceptorconfig - the configuration
IOException - if failed to bindpublic void unbind(SocketAddress address)
IoAcceptoraddress and disconnects all clients
connected there.
unbind in interface IoAcceptorpublic void unbindAll()
IoAcceptor
unbindAll in interface IoAcceptorpublic boolean isManaged(SocketAddress address)
IoServiceIoAcceptor, serviceAddress is a bind address.
If this service is an IoConnector, serviceAddress is a remote address.
isManaged in interface IoServicepublic Set<SocketAddress> getManagedServiceAddresses()
IoServiceSocketAddresses 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 IoServicepublic Set<IoSession> getManagedSessions(SocketAddress serviceAddress)
IoServiceIoAcceptor will assume the specified address is a local
address, and IoConnector will assume it's a remote address.
getManagedSessions in interface IoServiceserviceAddress - the address to return all sessions for.
public IoSession newSession(SocketAddress remoteAddress,
SocketAddress localAddress)
IoAcceptorIoSession that is bound to the specified
localAddress and remoteAddress which reuses
the localAddress that is already bound by IoAcceptor
via IoAcceptor.bind(SocketAddress, IoHandler).
This operation is optional. Please throw UnsupportedOperationException
if the transport type doesn't support this operation. This operation is
usually implemented for connectionless transport types.
newSession in interface IoAcceptorpublic IoServiceConfig getDefaultConfig()
IoService
getDefaultConfig in interface IoServicepublic IoFilterChainBuilder getFilterChainBuilder()
IoServiceIoFilterChainBuilder which will modify the
IoFilterChain of all IoSessions which is managed
by this service.
The default value is an empty DefaultIoFilterChainBuilder.
getFilterChainBuilder in interface IoServicepublic void setFilterChainBuilder(IoFilterChainBuilder builder)
IoServiceIoFilterChainBuilder which will modify the
IoFilterChain of all IoSessions which is managed
by this service.
If you specify null this property will be set to
an empty DefaultIoFilterChainBuilder.
setFilterChainBuilder in interface IoServicepublic DefaultIoFilterChainBuilder getFilterChain()
IoServiceIoService.getFilterChainBuilder() ).
Please note that the returned object is not a real IoFilterChain
but a DefaultIoFilterChainBuilder. Modifying the returned builder
won't affect the existing IoSessions at all, because
IoFilterChainBuilders affect only newly created IoSessions.
getFilterChain in interface IoServicepublic void addListener(IoServiceListener listener)
IoServiceIoServiceListener that listens any events related with
this service.
addListener in interface IoServicepublic void removeListener(IoServiceListener listener)
IoServiceIoServiceListener 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 | |||||||||