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, unbind
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getServiceType, getTimeout
public 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)
LogEnabled
setLog
in interface LogEnabled
logger
- 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
Configurable
configure
in interface Configurable
org.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
Exception
protected void doConfigure(org.apache.commons.configuration.HierarchicalConfiguration config) throws org.apache.commons.configuration.ConfigurationException
org.apache.commons.configuration.ConfigurationException
protected FileSystem getFileSystem()
protected void configureHelloName(org.apache.commons.configuration.Configuration handlerConfiguration) throws org.apache.commons.configuration.ConfigurationException
handlerConfiguration
- org.apache.commons.configuration.ConfigurationException
protected org.slf4j.Logger getLogger()
public boolean isEnabled()
isEnabled
in interface ServerMBean
public String getHelloName()
protected org.apache.james.protocols.api.Encryption getEncryption()
protected abstract int getDefaultPort()
public String getSocketType()
getSocketType
in interface ServerMBean
public boolean getStartTLSSupported()
ServerMBean
getStartTLSSupported
in interface ServerMBean
ServerMBean.getStartTLSSupported()
public int getMaximumConcurrentConnections()
ServerMBean
getMaximumConcurrentConnections
in interface ServerMBean
ServerMBean.getMaximumConcurrentConnections()
protected String getThreadPoolJMXPath()
protected Executor createBossExecutor()
createBossExecutor
in class org.apache.james.protocols.netty.AbstractAsyncServer
protected Executor createWorkerExecutor()
createWorkerExecutor
in class org.apache.james.protocols.netty.AbstractAsyncServer
protected abstract String getDefaultJMXName()
protected String[] getEnabledCipherSuites()
public boolean isStarted()
ServerMBean
isStarted
in interface ServerMBean
ServerMBean.isStarted()
public boolean start()
ServerMBean
start
in interface ServerMBean
ServerMBean.start()
public boolean stop()
ServerMBean
stop
in interface ServerMBean
ServerMBean.stop()
public long getHandledConnections()
ServerMBean
getHandledConnections
in interface ServerMBean
ServerMBean.getHandledConnections()
public int getCurrentConnections()
ServerMBean
getCurrentConnections
in interface ServerMBean
ServerMBean.getCurrentConnections()
protected ConnectionCountHandler getConnectionCountHandler()
public String[] getBoundAddresses()
getBoundAddresses
in interface ServerMBean
ServerMBean.getBoundAddresses()
protected void configureBootstrap(org.jboss.netty.bootstrap.ServerBootstrap bootstrap)
configureBootstrap
in class org.apache.james.protocols.netty.AbstractAsyncServer
protected 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.AbstractAsyncServer
Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.