com.filenet.wcm.toolkit.server.util
Class WcmThread

java.lang.Object
  extended byjava.lang.Thread
      extended bycom.filenet.wcm.toolkit.server.util.WcmThread
All Implemented Interfaces:
java.lang.Runnable

public class WcmThread
extends java.lang.Thread

This is a utility class designed to make launching threads easier. This class extends java.lang.Thread class and allows threads derived from this class to throw an exception when their finish() method is called. To do that, call setException() method in your run() method, and finish() method will automatically throw the exception.


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
WcmThread()
           
 
Method Summary
 void finish()
          Waits for the thread to finish or 15 minutes.
static void finishThread(WcmThread t)
          Just calls finish() method on the oThread, if it's not null.
protected  void setException(java.lang.Exception e)
          Sets exception that will be thrown by finish() method.
 
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
 

Constructor Detail

WcmThread

public WcmThread()
Method Detail

finish

public final void finish()
                  throws java.lang.Exception
Waits for the thread to finish or 15 minutes. Throws the Exception if setException method was previously called from run() method.

Throws:
java.lang.Exception - if setException() method was called from inside run() method.

finishThread

public static void finishThread(WcmThread t)
                         throws java.lang.Exception
Just calls finish() method on the oThread, if it's not null.

Parameters:
t - WcmThread object on which to invoke finish() method.
Throws:
java.lang.Exception - if thrown by finish() method of thread t

setException

protected final void setException(java.lang.Exception e)
Sets exception that will be thrown by finish() method.

Parameters:
e - Exception to be thrown by finish() method.


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.