|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
jmri.jmrit.audio.AbstractAudioThread
public abstract class AbstractAudioThread
Base implementation of all common thread code for use by threads in the various Audio classes.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Fields inherited from interface jmri.jmrit.audio.AudioThread |
|---|
GET, NA, SET |
| Constructor Summary | |
|---|---|
AbstractAudioThread()
Default constructor that gives this thread a unique name based on the value of the static counter |
|
| Method Summary | |
|---|---|
boolean |
alive()
Checks if the thread is still alive (or in the process of shutting down) Once cleanup has finished, this should return False |
protected void |
cleanup()
Perform necessary cleanup routines before shutting down |
void |
die()
Method used to tell the thread that it should shutdown |
protected boolean |
dying()
Checks if the thread is in the process of shutting down |
protected static void |
snooze(long ms)
Sleep for the specified number of milliseconds (Avoids cluttering the main code with the try-catch construct) |
| 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, run, 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 |
| Methods inherited from interface java.lang.Runnable |
|---|
run |
| Constructor Detail |
|---|
public AbstractAudioThread()
| Method Detail |
|---|
protected void cleanup()
public boolean alive()
AudioThreadOnce cleanup has finished, this should return False
alive in interface AudioThreadpublic void die()
AudioThread
die in interface AudioThreadprotected boolean dying()
protected static void snooze(long ms)
(Avoids cluttering the main code with the try-catch construct)
ms - number of milliseconds to sleep for
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||