com.multisoftgroup.jerry.server.thread
Class AbstractServerThread

java.lang.Object
  extended by com.multisoftgroup.jerry.server.thread.AbstractServerThread
All Implemented Interfaces:
Runnable

public abstract class AbstractServerThread
extends Object
implements Runnable


Constructor Summary
protected AbstractServerThread(String threadName)
           
 
Method Summary
protected  String getThreadName()
           
 boolean isRunning()
           
protected abstract  void notifyStarting()
           
protected abstract  void notifyStopped()
           
 void run()
           
protected abstract  void runInnerLoop()
          Called with each pass through the thread's main loop.
 boolean start()
           
 boolean start(ThreadPoolExecutor executor)
           
 boolean start(ThreadPoolExecutor executor, long timeoutMS)
           
 boolean stop()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractServerThread

protected AbstractServerThread(String threadName)
Method Detail

run

public final void run()
Specified by:
run in interface Runnable

isRunning

public final boolean isRunning()

start

public final boolean start(ThreadPoolExecutor executor,
                           long timeoutMS)
                    throws StartServerExeption
Throws:
StartServerExeption

start

public final boolean start(ThreadPoolExecutor executor)
                    throws StartServerExeption
Throws:
StartServerExeption

start

public final boolean start()
                    throws StartServerExeption
Throws:
StartServerExeption

stop

public final boolean stop()
                   throws StopServerException
Throws:
StopServerException

getThreadName

protected String getThreadName()

runInnerLoop

protected abstract void runInnerLoop()
                              throws Exception
Called with each pass through the thread's main loop.

Throws:
Exception - If the method throws an exception, the thread will be stopped, and the exception passed to the stoppable thread's error handler. The notifyStopping() method will still be called (assuming the error handler does not abort the application).

notifyStarting

protected abstract void notifyStarting()

notifyStopped

protected abstract void notifyStopped()

toString

public String toString()
Overrides:
toString in class Object