Client
Class StoppableThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--Client.StoppableThread
All Implemented Interfaces:
java.lang.Runnable

public class StoppableThread
extends java.lang.Thread

A class that represents a thread that can be requested to stop. It is vital that inheriting classes will poll on stopRequested() variable for stop requests, to implement that functionality.


Field Summary
private  boolean stopRequested
          predicate for stop requestes.
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ
 
Constructor Summary
StoppableThread()
           
 
Method Summary
 void requestStop(java.lang.Object o)
          Request a stop.
 boolean stopRequested()
          A predicate method that returns whether stop has been requested
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, run, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

stopRequested

private boolean stopRequested
predicate for stop requestes.
Constructor Detail

StoppableThread

public StoppableThread()
Method Detail

requestStop

public void requestStop(java.lang.Object o)
Request a stop.

stopRequested

public boolean stopRequested()
A predicate method that returns whether stop has been requested
Returns:
True if stop has been requested