de.esw.eengine.net
Class AbstractServer
java.lang.Object
de.esw.eengine.net.ChannelHelper
de.esw.eengine.net.AbstractServer
- All Implemented Interfaces:
- java.lang.Runnable
- Direct Known Subclasses:
- TCPServer, UDPServer
public abstract class AbstractServer
- extends ChannelHelper
- implements java.lang.Runnable
- Since:
- 1.0
- Version:
- $Id: AbstractServer.java 201 2005-07-17 18:38:14Z markusw $
- Author:
- markusw
|
Constructor Summary |
AbstractServer(int bufferSize,
java.lang.String charset)
Creates an AbstractServer with a default thread pool of at
least 1 threads and at most 5 threads and a timeout of 30 seconds. |
AbstractServer(int bufferSize,
java.lang.String charset,
int minThreads,
int maxThreads,
int threadTimeout)
|
| Methods inherited from class de.esw.eengine.net.ChannelHelper |
readBoolean, readBytes, readFile, readInt, readLong, readObject, readString, writeBoolean, writeBytes, writeFile, writeInt, writeLong, writeObject, writeString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractServer
public AbstractServer(int bufferSize,
java.lang.String charset)
throws EEngineException
- Creates an
AbstractServer with a default thread pool of at
least 1 threads and at most 5 threads and a timeout of 30 seconds.
- Parameters:
bufferSize - Size of the communication buffer in bytescharset - Charset to use for encoding and decoding
- Throws:
EEngineException - Thrown on network i/o errors
AbstractServer
public AbstractServer(int bufferSize,
java.lang.String charset,
int minThreads,
int maxThreads,
int threadTimeout)
throws EEngineException
- Parameters:
bufferSize - Size of the communication buffer in bytescharset - Charset to use for encoding and decodingminThreads - Minimal amount of threads to keep in the poolmaxThreads - Maximal amount of theads to be in poolthreadTimeout - Timeout in seconds the thread pool uses to reduce size
- Throws:
EEngineException - Thrown on network i/o errors
run
public void run()
- Specified by:
run in interface java.lang.Runnable
- See Also:
Runnable.run()
shutdown
public void shutdown()
- Terminates the server
setWriteRequest
public void setWriteRequest(java.nio.channels.SelectionKey key,
boolean write)
- Parameters:
key - Key to change writeable state forwrite - True if we want to write, false otherwise
dispose
public void dispose()
throws EEngineException
- Throws:
EEngineException - Thrown on network i/o errors