public abstract class AbstractConfigurableAsyncServer extends org.apache.james.protocols.netty.AbstractAsyncServer implements LogEnabled, Configurable, ServerMBean
| Modifier and Type | Field and Description |
|---|---|
protected int |
connectionLimit |
protected int |
connPerIP |
static int |
DEFAULT_BACKLOG
The default value for the connection backlog.
|
static int |
DEFAULT_MAX_EXECUTOR_COUNT |
static int |
DEFAULT_TIMEOUT
The default value for the connection timeout.
|
static String |
HELLO_NAME
The name of the parameter defining the service hello name.
|
protected String |
jmxName |
| Constructor and Description |
|---|
AbstractConfigurableAsyncServer() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.commons.configuration.HierarchicalConfiguration config)
Configure the object.
|
protected void |
configureBootstrap(org.jboss.netty.bootstrap.ServerBootstrap bootstrap) |
protected void |
configureHelloName(org.apache.commons.configuration.Configuration handlerConfiguration)
Configure the helloName for the given Configuration
|
protected Executor |
createBossExecutor() |
protected abstract org.jboss.netty.channel.ChannelUpstreamHandler |
createCoreHandler() |
protected org.jboss.netty.handler.execution.ExecutionHandler |
createExecutionHander()
Create a new
ExecutionHandler which is used to execute IO-Bound handlers |
protected org.jboss.netty.channel.ChannelPipelineFactory |
createPipelineFactory(org.jboss.netty.channel.group.ChannelGroup group) |
protected Executor |
createWorkerExecutor() |
void |
destroy() |
protected void |
doConfigure(org.apache.commons.configuration.HierarchicalConfiguration config) |
String[] |
getBoundAddresses() |
protected ConnectionCountHandler |
getConnectionCountHandler() |
int |
getCurrentConnections()
Return the current connection count
|
protected abstract String |
getDefaultJMXName()
Return the default name of the the server in JMX if none is configured
via "jmxname" in the configuration
|
protected abstract int |
getDefaultPort()
Return the default port which will get used for this server if non is
specify in the configuration
|
protected String[] |
getEnabledCipherSuites() |
protected org.apache.james.protocols.api.Encryption |
getEncryption() |
protected org.jboss.netty.handler.execution.ExecutionHandler |
getExecutionHandler()
Return the
ExecutionHandler or null if non should be used. |
protected FileSystem |
getFileSystem()
Return the FileSystem
|
long |
getHandledConnections()
Return the count of handled connections till startup
|
String |
getHelloName()
Return helloName for this server
|
protected org.slf4j.Logger |
getLogger()
Return the logger
|
int |
getMaximumConcurrentConnections()
Return the maximum allowed concurrent connections for the server
|
String |
getSocketType()
Return the socket type.
|
boolean |
getStartTLSSupported()
Return true if startTLS is supported by the server
|
protected String |
getThreadPoolJMXPath() |
void |
init() |
boolean |
isEnabled()
Return if the server is enabled by the configuration
|
boolean |
isStarted()
Return true if the server is started, which basicly means it is bound to
a address and accept connections
|
protected void |
postDestroy() |
protected void |
preInit()
This method is called on init of the Server.
|
protected void |
registerMBean() |
void |
setFileSystem(FileSystem filesystem) |
void |
setLog(org.slf4j.Logger logger)
Sets the service log.
|
boolean |
start()
Start the server
|
boolean |
stop()
Stop the server
|
protected void |
unregisterMBean() |
bind, createSocketChannelFactory, getBacklog, getIoWorkerCount, getListenAddresses, getTimeout, isBound, setBacklog, setIoWorkerCount, setListenAddresses, setTimeout, unbindclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceType, getTimeoutpublic static final int DEFAULT_BACKLOG
public static final int DEFAULT_TIMEOUT
public static final String HELLO_NAME
public static final int DEFAULT_MAX_EXECUTOR_COUNT
protected int connPerIP
protected int connectionLimit
protected String jmxName
public final void setFileSystem(FileSystem filesystem)
public final void setLog(org.slf4j.Logger logger)
LogEnabledsetLog in interface LogEnabledlogger - not nullLogEnabled.setLog(org.slf4j.Logger)protected void registerMBean()
protected void unregisterMBean()
public final void configure(org.apache.commons.configuration.HierarchicalConfiguration config)
throws org.apache.commons.configuration.ConfigurationException
Configurableconfigure in interface Configurableorg.apache.commons.configuration.ConfigurationException#configure(org.apache.commons.configuration.HierarchicalConfiguration)@PostConstruct public final void init() throws Exception
Exception@PreDestroy public final void destroy()
protected void postDestroy()
protected void preInit()
throws Exception
Exceptionprotected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration config)
throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationExceptionprotected FileSystem getFileSystem()
protected void configureHelloName(org.apache.commons.configuration.Configuration handlerConfiguration)
throws org.apache.commons.configuration.ConfigurationException
handlerConfiguration - org.apache.commons.configuration.ConfigurationExceptionprotected org.slf4j.Logger getLogger()
public boolean isEnabled()
isEnabled in interface ServerMBeanpublic String getHelloName()
protected org.apache.james.protocols.api.Encryption getEncryption()
protected abstract int getDefaultPort()
public String getSocketType()
getSocketType in interface ServerMBeanpublic boolean getStartTLSSupported()
ServerMBeangetStartTLSSupported in interface ServerMBeanServerMBean.getStartTLSSupported()public int getMaximumConcurrentConnections()
ServerMBeangetMaximumConcurrentConnections in interface ServerMBeanServerMBean.getMaximumConcurrentConnections()protected String getThreadPoolJMXPath()
protected Executor createBossExecutor()
createBossExecutor in class org.apache.james.protocols.netty.AbstractAsyncServerprotected Executor createWorkerExecutor()
createWorkerExecutor in class org.apache.james.protocols.netty.AbstractAsyncServerprotected abstract String getDefaultJMXName()
protected String[] getEnabledCipherSuites()
public boolean isStarted()
ServerMBeanisStarted in interface ServerMBeanServerMBean.isStarted()public boolean start()
ServerMBeanstart in interface ServerMBeanServerMBean.start()public boolean stop()
ServerMBeanstop in interface ServerMBeanServerMBean.stop()public long getHandledConnections()
ServerMBeangetHandledConnections in interface ServerMBeanServerMBean.getHandledConnections()public int getCurrentConnections()
ServerMBeangetCurrentConnections in interface ServerMBeanServerMBean.getCurrentConnections()protected ConnectionCountHandler getConnectionCountHandler()
public String[] getBoundAddresses()
getBoundAddresses in interface ServerMBeanServerMBean.getBoundAddresses()protected void configureBootstrap(org.jboss.netty.bootstrap.ServerBootstrap bootstrap)
configureBootstrap in class org.apache.james.protocols.netty.AbstractAsyncServerprotected org.jboss.netty.handler.execution.ExecutionHandler createExecutionHander()
ExecutionHandler which is used to execute IO-Bound handlersprotected org.jboss.netty.handler.execution.ExecutionHandler getExecutionHandler()
ExecutionHandler or null if non should be used. Be sure you call createExecutionHander() beforeprotected abstract org.jboss.netty.channel.ChannelUpstreamHandler createCoreHandler()
protected org.jboss.netty.channel.ChannelPipelineFactory createPipelineFactory(org.jboss.netty.channel.group.ChannelGroup group)
createPipelineFactory in class org.apache.james.protocols.netty.AbstractAsyncServerCopyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.