org.codehaus.mojo.exec
Class MainWithThreads

java.lang.Object
  extended by java.lang.Thread
      extended by org.codehaus.mojo.exec.MainWithThreads
All Implemented Interfaces:
Runnable

public class MainWithThreads
extends Thread

Author:
David Smiley

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static String ALL_EXITED
           
private  String message
           
private  int millisecsToSleep
           
static String TIMER_IGNORED
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MainWithThreads(int millisecsToSleep, String message)
           
 
Method Summary
static void main(String[] args)
          both daemon threads will be interrupted as soon as the non daemon thread is done.
private static boolean optionsContains(String[] args, String option)
           
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_EXITED

public static final String ALL_EXITED
See Also:
Constant Field Values

TIMER_IGNORED

public static final String TIMER_IGNORED
See Also:
Constant Field Values

millisecsToSleep

private int millisecsToSleep

message

private String message
Constructor Detail

MainWithThreads

public MainWithThreads(int millisecsToSleep,
                       String message)
Method Detail

main

public static void main(String[] args)
both daemon threads will be interrupted as soon as the non daemon thread is done. the responsive daemon thread will be interrupted right away. - if the timer is cancelled (using 'cancelTimer' as argument), the timer will die on itself after all the other threads - if not, one must use a time out to stop joining on that unresponsive daemon thread


optionsContains

private static boolean optionsContains(String[] args,
                                       String option)

run

public void run()
Specified by:
run in interface Runnable
Overrides:
run in class Thread


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.