de.bb.util
Class ThreadManager.Thread

java.lang.Object
  extended by java.lang.Thread
      extended by de.bb.util.ThreadManager.Thread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
ThreadManager

public static class ThreadManager.Thread
extends java.lang.Thread

Abstract class for all threads used with the ThreadManager.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ThreadManager.Thread(ThreadManager tm)
          Ct to create a manageable thread.
 
Method Summary
 boolean isBusy()
          Is the current thread busy?
protected  boolean mustDie()
          This function MUST be polled during the threads run loop.
protected  void requestDie()
          Force termination of the current thread.
protected  void setBusy()
          This function MUST be called from the threads main loop BEFORE the real work starts.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, 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
 

Constructor Detail

ThreadManager.Thread

public ThreadManager.Thread(ThreadManager tm)
Ct to create a manageable thread.

Parameters:
tm - the ThreadManager object
Method Detail

setBusy

protected void setBusy()
This function MUST be called from the threads main loop BEFORE the real work starts.


requestDie

protected void requestDie()
Force termination of the current thread. Next call of mustDie() will return true;


mustDie

protected boolean mustDie()
This function MUST be polled during the threads run loop.

Returns:
true if the thread must terminate its work.

isBusy

public boolean isBusy()
Is the current thread busy? This functions gives only then correct information, if the functions setBusy() and mustDie() are used correctly.

Returns:
true if the current thread does some real work.