QJCC homepage

biz.chitec.quarterback.util
Class StoppableThread

java.lang.Object
  extended byjava.lang.Thread
      extended bybiz.chitec.quarterback.util.StoppableThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
CBServerConnector.LineWakeupToggler, ConnectionTableFrame.FreeFloatingHandleThread, Killer, LoggingReceiverUpdater, SessionedServerConnector.BackgroundConnectionOpener

public abstract class StoppableThread
extends java.lang.Thread

Thread with a special stopping method. stopGracefully() stops the thread somehow gracefully. How this is done is up to the implementation.

Version:
$Id: e692b0535d3bb735fdc565a1607df1db808138df $
Author:
chitec/Dirk Hillbrecht 2001. Distributed under the terms of the GNU LGPL.

Nested Class Summary
protected  class StoppableThread.StopException
          Exception for gracefully stopping the run() method.
 
Field Summary
protected  boolean shouldbestopped
          The variable keeping the information that this thread should be stopped.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
StoppableThread()
          Parameterless constructor.
StoppableThread(java.lang.String name)
          Constructor with thread name
 
Method Summary
 boolean shouldBeStopped()
          Element method for the should-be-stopped variable.
 void stopGracefully()
          Stops the operation of the run() method somehow gracefully.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shouldbestopped

protected boolean shouldbestopped
The variable keeping the information that this thread should be stopped.

Constructor Detail

StoppableThread

public StoppableThread()
Parameterless constructor.


StoppableThread

public StoppableThread(java.lang.String name)
Constructor with thread name

Method Detail

shouldBeStopped

public boolean shouldBeStopped()
Element method for the should-be-stopped variable.


stopGracefully

public void stopGracefully()
Stops the operation of the run() method somehow gracefully. This method does just set an internal variable. To evaluate that one is up to the implementation.


QJCC homepage