|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.comm.AbstractServer
com.kuka.comm.AbstractThreadedServer
public abstract class AbstractThreadedServer
Abstract class to implement interface methods for a Server. Needs to be derived by a more Connection
-specific version of server.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.kuka.comm.AbstractServer |
|---|
AbstractServer.ConnectionConsumer |
| Constructor Summary | |
|---|---|
AbstractThreadedServer()
|
|
| Method Summary | |
|---|---|
boolean |
isRunning()
Checks whenever the server thread is currently active. |
protected boolean |
isStopRequested()
Server specific method to check if server is going to stop. |
protected boolean |
isThreadAlive()
Return true of the server thread is running. |
protected abstract void |
serverThread()
Implement the server thread! |
protected void |
setStopRequested(boolean stopRequested)
Server method to stop during next cycle. |
void |
start()
Starts the server as a separate thread. |
void |
stop()
Stops the server closes all created connections listed in its internal list of connections. |
| Methods inherited from class com.kuka.comm.AbstractServer |
|---|
addConnection, addServerListener, closeAllConnections, countConnections, fireAcceptedConnection, fireIncomingConnection, fireRejectedConnection, forEachConnection, getConnections, hasConnections, removeConnection, removeServerListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractThreadedServer()
| Method Detail |
|---|
public void start()
Server
public void stop()
Server
public boolean isRunning()
The default way of determining if the server is running, is to check if the thread is running. Subclasses may overwrite this, if their thread could also be running even if they are not 'officially' running (e.g. 'stop' as been requested, but their thread needs to keep running).
true if server thread is running, false otherwise.protected final boolean isThreadAlive()
protected final void setStopRequested(boolean stopRequested)
stopRequested - true if server should stop.protected final boolean isStopRequested()
True if server is going to stop, false otherwise.protected abstract void serverThread()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||