public class ThreadServer extends AbstractServer implements java.lang.Runnable
Modifier and Type | Field and Description |
---|---|
protected ServerStatus[] |
loopCondition |
protected ServerStatus[] |
processingCondition |
protected java.lang.Thread |
thread
Thread for current server.
|
STATUS_CHANGED
Constructor and Description |
---|
ThreadServer() |
Modifier and Type | Method and Description |
---|---|
void |
boot()
Start server.
|
void |
boot(boolean isBlock)
Start server.
|
void |
down()
Stop server.
|
void |
down(boolean isBlock)
Down server.
|
protected void |
loop()
Loop for task.
|
protected void |
postBoot() |
protected void |
preDown()
Pre-process for down.
|
protected void |
process()
Method for task.
|
void |
run()
Template method for execution.
|
java.lang.String |
toString() |
addServerListener, changeStatus, clearException, fireEvent, getStatus, handleError, initialize, isStatus, removeServerListener, stateChanged, terminate, waitStatus
protected java.lang.Thread thread
protected final ServerStatus[] loopCondition
protected final ServerStatus[] processingCondition
public void run()
run
in interface java.lang.Runnable
AbstractServer.initialize()
,
process()
,
AbstractServer.handleError(Throwable)
,
AbstractServer.terminate()
protected void loop()
protected void process() throws java.lang.Exception
Must be implemented under performance consideration.
process
in class AbstractServer
java.lang.Exception
- If exception in processpublic void boot()
Server
public void boot(boolean isBlock)
Wait for server to be start if bBlock
is true
isBlock
- wait flagprotected void postBoot()
public void down()
Server
public void down(boolean isBlock)
isBlock
- flag if wait to be doneprotected void preDown()
public java.lang.String toString()
toString
in class java.lang.Object