org.apache.mina.common

Interface IoServiceConfig

All Superinterfaces:
Cloneable
Known Subinterfaces:
DatagramServiceConfig, IoAcceptorConfig, IoConnectorConfig
Known Implementing Classes:
BaseIoAcceptorConfig, BaseIoConnectorConfig, BaseIoServiceConfig, DatagramAcceptorConfig, DatagramConnectorConfig, SocketAcceptorConfig, SocketConnectorConfig

public interface IoServiceConfig
extends Cloneable

A configuration which is used to configure IoService.

Method Summary

Object
clone()
Returns a deep clone of this configuration.
DefaultIoFilterChainBuilder
getFilterChain()
A shortcut for ( ( DefaultIoFilterChainBuilder ) getFilterChainBuilder() ).
IoFilterChainBuilder
getFilterChainBuilder()
Returns the IoFilterChainBuilder which will modify the IoFilterChain of all IoSessions which is created with this configuration.
IoSessionConfig
getSessionConfig()
Resturns the default configuration of the new IoSessions.
ThreadModel
getThreadModel()
Returns the default ThreadModel of the IoService.
void
setFilterChainBuilder(IoFilterChainBuilder builder)
Sets the IoFilterChainBuilder which will modify the IoFilterChain of all IoSessions which is created with this configuration.
void
setThreadModel(ThreadModel threadModel)
Sets the default ThreadModel of the IoService.

Method Details

clone

public Object clone()
Returns a deep clone of this configuration.

getFilterChain

public DefaultIoFilterChainBuilder getFilterChain()
A shortcut for ( ( DefaultIoFilterChainBuilder ) 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.

getFilterChainBuilder

public IoFilterChainBuilder getFilterChainBuilder()
Returns the IoFilterChainBuilder which will modify the IoFilterChain of all IoSessions which is created with this configuration. The default value is an empty DefaultIoFilterChainBuilder.

getSessionConfig

public IoSessionConfig getSessionConfig()
Resturns the default configuration of the new IoSessions.

getThreadModel

public ThreadModel getThreadModel()
Returns the default ThreadModel of the IoService. The default value is a ExecutorThreadModel() whose service name is 'AnonymousIoService' and which has 16 maximum active threads. It is strongly recommended to set a new ExecutorThreadModel by calling ExecutorThreadModel.getInstance(String).

setFilterChainBuilder

public void setFilterChainBuilder(IoFilterChainBuilder builder)
Sets the IoFilterChainBuilder which will modify the IoFilterChain of all IoSessions which is created with this configuration. If you specify null this property will be set to an empty DefaultIoFilterChainBuilder.

setThreadModel

public void setThreadModel(ThreadModel threadModel)
Sets the default ThreadModel of the IoService. If you specify null, this property will be set to the default value. The default value is an ExecutorThreadModel whose service name is 'AnonymousIoService' with 16 threads. It is strongly recommended to set a new ExecutorThreadModel by calling ExecutorThreadModel.getInstance(String).