Package org.apache.mina.common.support
Class BaseIoService
java.lang.Object
org.apache.mina.common.support.BaseIoService
- All Implemented Interfaces:
IoService
- Direct Known Subclasses:
BaseIoAcceptor,BaseIoConnector
Base implementation of
IoServices.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(IoServiceListener listener) Adds anIoServiceListenerthat listens any events related with this service.A shortcut for ( ( DefaultIoFilterChainBuilder )IoService.getFilterChainBuilder()).Returns the globalIoFilterChainBuilderwhich will modify theIoFilterChainof allIoSessions which is managed by this service.protected IoServiceListenerSupportReturns allSocketAddresses this service is managing.getManagedSessions(SocketAddress serviceAddress) Returns all sessions with the specified remote or local address, which are currently managed by this service.booleanisManaged(SocketAddress serviceAddress) Returns true if this service is managing the specified serviceAddress.voidremoveListener(IoServiceListener listener) Removed an existingIoServiceListenerthat listens any events related with this service.voidSets the globalIoFilterChainBuilderwhich will modify theIoFilterChainof allIoSessions which is managed by this service.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.mina.common.IoService
getDefaultConfig
-
Constructor Details
-
BaseIoService
protected BaseIoService()
-
-
Method Details
-
getFilterChainBuilder
Description copied from interface:IoServiceReturns the globalIoFilterChainBuilderwhich will modify theIoFilterChainof allIoSessions which is managed by this service. The default value is an emptyDefaultIoFilterChainBuilder.- Specified by:
getFilterChainBuilderin interfaceIoService
-
setFilterChainBuilder
Description copied from interface:IoServiceSets the globalIoFilterChainBuilderwhich will modify theIoFilterChainof allIoSessions which is managed by this service. If you specify null this property will be set to an emptyDefaultIoFilterChainBuilder.- Specified by:
setFilterChainBuilderin interfaceIoService
-
getFilterChain
Description copied from interface:IoServiceA shortcut for ( ( DefaultIoFilterChainBuilder )IoService.getFilterChainBuilder()). Please note that the returned object is not a realIoFilterChainbut aDefaultIoFilterChainBuilder. Modifying the returned builder won't affect the existingIoSessions at all, becauseIoFilterChainBuilders affect only newly createdIoSessions.- Specified by:
getFilterChainin interfaceIoService
-
addListener
Description copied from interface:IoServiceAdds anIoServiceListenerthat listens any events related with this service.- Specified by:
addListenerin interfaceIoService
-
removeListener
Description copied from interface:IoServiceRemoved an existingIoServiceListenerthat listens any events related with this service.- Specified by:
removeListenerin interfaceIoService
-
getManagedServiceAddresses
Description copied from interface:IoServiceReturns allSocketAddresses this service is managing. If this service is anIoAcceptor, a set of bind addresses will be returned. If this service is anIoConnector, a set of remote addresses will be returned.- Specified by:
getManagedServiceAddressesin interfaceIoService
-
getManagedSessions
Description copied from interface:IoServiceReturns all sessions with the specified remote or local address, which are currently managed by this service.IoAcceptorwill assume the specified address is a local address, andIoConnectorwill assume it's a remote address.- Specified by:
getManagedSessionsin interfaceIoService- Parameters:
serviceAddress- the address to return all sessions for.- Returns:
- the sessions. An empty collection if there's no session.
-
isManaged
Description copied from interface:IoServiceReturns true if this service is managing the specified serviceAddress. If this service is anIoAcceptor, serviceAddress is a bind address. If this service is anIoConnector, serviceAddress is a remote address. -
getListeners
-