|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.netseeker.ejoe.EJServer
public class EJServer
This is the server component of EJOE. EJOE is a request object broker in it's natural meaning. You have to use this component if you want retrieve and send data from/to EJOE clients. EJOE offers basically three things for you:
Basic usage:
EJServer server = new EJServer( new EchoHandler() );
//to allow persistent client connections use
//server.enablePersistentConnections( true );
//to use old style blocking IO instead of NIO use
//server.enableNonBlockingIO( false );
server.start();
...
server.stop();
| Constructor Summary | |
|---|---|
EJServer()
Creates an instance of EJServer pre-configured with settings from the global ejserver.properties file. |
|
EJServer(java.util.Properties properties)
Creates an instance of EJServer pre-configured with settings from the given properties store |
|
EJServer(ServerHandler handler)
Creates an instance of the EJOE server component pre-configured whith a default value for the used port |
|
EJServer(ServerHandler handler,
int port)
Creates an instance of the EJOE server component |
|
EJServer(ServerHandler handler,
java.lang.String bindAddr)
Creates an instance of the EJOE server component pre-configured whith a default value for the used port |
|
EJServer(ServerHandler handler,
java.lang.String bindAddr,
int port)
Creates an instance of the EJOE server component |
|
EJServer(java.lang.String pathToConfigFile)
Creates an instance of EJServer pre-configured with settings from a global properties file. |
|
| Method Summary | |
|---|---|
void |
enableCompression(boolean enable)
Enables or disables the usage of compressing/decompressing for outgoing/incoming data. |
void |
enableCompression(int compressionLevel)
Enables the usage of compressing/decompressing for outgoing/incoming data with the given compression level. |
void |
enableHttpPackaging(boolean enable)
Enables/disables support for http packaging. |
void |
enableNonBlockingIO(boolean enable)
Enables/disables new style non-blocking IO for read and write operations. |
void |
enablePersistentConnections(boolean enable)
Enables/disables support for persistents client connections. |
void |
enableRemoteClassLoading(boolean enable)
Enables support for remote classloading |
void |
enableThreadPoolResizeControl(boolean enable)
Enables/Disables automic, periodic control of the used worker pools. |
void |
enableThreadPoolResizeControl(boolean enable,
long controlPeriod)
This method works exactly as #enableThreadedProcessorUsage(boolean) but allows setting of a custom time
period between control checks of the used worker pools. |
int |
getConnectionProcessors()
Returns the number of Connection Processors used for delegating network IO operations to reader/writer workers |
EJServerConfigMBean |
getJMXConfigurationBean()
Returns a JMX compliant bean to configure EJServer via JMX |
int |
getMaxReadProcessors()
Returns the current amount of supported concurrent read processor threads. |
int |
getMaxWriteProcessors()
Returns the current amount of supported concurrent write processor threads. |
IServerInfo |
getServerInfo()
|
boolean |
hasCommpression()
Returns whether compression has been enabled or not. |
boolean |
hasHttPackaging()
Returns whether support for HTTP packaging has been enabled or not. |
boolean |
hasNonBlockingIO()
Returns whether NIO has been enabled or not. |
boolean |
hasPersistentConnections()
Returns whether support for persistent connections has been enabled or not. |
boolean |
isRunning()
Indicates if this EJServer is running and ready to accept and process incoming connections |
void |
setConnectionProcessors(int count)
Sets the number of Connection Processors to use for delegating network IO operations to reader/writer workers. |
void |
setMaxReadProcessors(int maxProcessors)
Sets the amount of threads used for processing read operations on accepted connections. |
void |
setMaxWriteProcessors(int maxProcessors)
Sets the amount of threads used for processing write operations. |
void |
start()
(Re)Starts the main server as well as the class loader server (if it's configured) |
void |
stop()
Stops the main server as well as the class loader server (if it's running) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EJServer(ServerHandler handler)
handler - an implementation of de.netseeker.ejoe.ServerHandler
public EJServer(ServerHandler handler,
java.lang.String bindAddr)
handler - an implementation of de.netseeker.ejoe.ServerHandlerbindAddr - the IP address identifying the network interface to which EJServer should bind itself
public EJServer(ServerHandler handler,
int port)
handler - an implementation of de.netseeker.ejoe.ServerHandlerport - the port EJOE should listen to
public EJServer(ServerHandler handler,
java.lang.String bindAddr,
int port)
handler - an implementation of de.netseeker.ejoe.ServerHandlerbindAddr - the IP address identifying the network interface to which EJServer should bind itselfport - the port EJOE should listen topublic EJServer()
public EJServer(java.util.Properties properties)
properties - properties store containing EJServer settingspublic EJServer(java.lang.String pathToConfigFile)
pathToConfigFile - path to the properties file| Method Detail |
|---|
public boolean isRunning()
public int getMaxReadProcessors()
public void setMaxReadProcessors(int maxProcessors)
maxProcessors - new amount of threads used for processing accepted connectionssetMaxWriteProcessors(int)public int getMaxWriteProcessors()
public void setMaxWriteProcessors(int maxProcessors)
maxProcessors - new amount of threads used for processing io socket write operationssetMaxReadProcessors(int)public void enableThreadPoolResizeControl(boolean enable)
enable - enableThreadPoolResizeControl(boolean, long)
public void enableThreadPoolResizeControl(boolean enable,
long controlPeriod)
#enableThreadedProcessorUsage(boolean) but allows setting of a custom time
period between control checks of the used worker pools.
enable - controlPeriod - period between control checks in millisecondsenableThreadPoolResizeControl(boolean)public boolean hasCommpression()
public void enableCompression(boolean enable)
SerializeAdapterpublic void enableCompression(int compressionLevel)
compressionLevel - the level of compression to use, must be in range of 0-9SerializeAdapterpublic boolean hasNonBlockingIO()
public void enableNonBlockingIO(boolean enable)
public boolean hasPersistentConnections()
public void enablePersistentConnections(boolean enable)
enable - public void enableHttpPackaging(boolean enable)
enable - public boolean hasHttPackaging()
public int getConnectionProcessors()
public void setConnectionProcessors(int count)
count - the number of Connection Processors to usepublic void enableRemoteClassLoading(boolean enable)
enable - public EJServerConfigMBean getJMXConfigurationBean()
public IServerInfo getServerInfo()
public void start()
throws java.io.IOException
java.io.IOExceptionpublic void stop()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||