de.hedenus.mobilegui
Class Worker

java.lang.Object
  extended by de.hedenus.mobilegui.Worker
All Implemented Interfaces:
java.lang.Runnable

public class Worker
extends java.lang.Object
implements java.lang.Runnable

A worker thread which performs jobs for the GUI.

Author:
Michael Hedenus

Constructor Summary
Worker()
           
 
Method Summary
 void addJob(java.lang.Runnable job)
           
 void finish()
          This will finish the worker and abandon any pending job.
 void handleException(java.lang.Throwable t)
          Fall-back method to handle an uncaught exception thrown by a job's run() or done() method.
 boolean isFinish()
           
 void run()
           
 java.lang.Object semaphore()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Worker

public Worker()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

handleException

public void handleException(java.lang.Throwable t)
Fall-back method to handle an uncaught exception thrown by a job's run() or done() method.


semaphore

public java.lang.Object semaphore()

addJob

public void addJob(java.lang.Runnable job)

isFinish

public boolean isFinish()

finish

public void finish()
This will finish the worker and abandon any pending job. but the currently executed job will be finished.