org.codehaus.mojo.exec
Class MainWithThreads
java.lang.Object
java.lang.Thread
org.codehaus.mojo.exec.MainWithThreads
- All Implemented Interfaces:
- Runnable
public class MainWithThreads
- extends Thread
- Author:
- David Smiley
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 |
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
MainWithThreads
public MainWithThreads(int millisecsToSleep,
String message)
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.