org.openstreetmap.osmosis.core.pipeline.common
Class TaskRunner

java.lang.Object
  extended by java.lang.Thread
      extended by org.openstreetmap.osmosis.core.pipeline.common.TaskRunner
All Implemented Interfaces:
java.lang.Runnable

public class TaskRunner
extends java.lang.Thread

A thread implementation for launching a runnable task.

Author:
Brett Henderson

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
TaskRunner(java.lang.Runnable task, java.lang.String name)
          Creates a new instance.
 
Method Summary
 java.lang.Throwable getException()
          Returns the reason for abnormal termination.
 boolean isSuccessful()
          This can be called after the thread has completed to determine if the thread terminated normally.
 
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

TaskRunner

public TaskRunner(java.lang.Runnable task,
                  java.lang.String name)
Creates a new instance.

Parameters:
task - The task to be executed.
name - The name of the thread.
Method Detail

isSuccessful

public boolean isSuccessful()
This can be called after the thread has completed to determine if the thread terminated normally.

Returns:
True if the thread terminated normally.

getException

public java.lang.Throwable getException()
Returns the reason for abnormal termination.

Returns:
The exception causing the failure.