Package ptolemy.kernel.util.test
Class TestPtolemyThread
- java.lang.Object
-
- java.lang.Thread
-
- ptolemy.kernel.util.PtolemyThread
-
- ptolemy.kernel.util.test.TestPtolemyThread
-
- All Implemented Interfaces:
java.lang.Runnable
,Debuggable
public class TestPtolemyThread extends PtolemyThread
This class is used to test the protected _debug() method in kernel.util.PtolemyThread.- Since:
- Ptolemy II 2.3
- Version:
- $Id$
- Author:
- Christopher Hylands
- Pt.AcceptedRating:
- Red (cxheecs.berkeley.edu)
- Pt.ProposedRating:
- Red (cxh)
-
-
Field Summary
-
Fields inherited from class ptolemy.kernel.util.PtolemyThread
_debugging, _debugListeners
-
-
Constructor Summary
Constructors Constructor Description TestPtolemyThread()
Construct a new TestPtolemyThread object.TestPtolemyThread(java.lang.Runnable target)
Construct a new TestPtolemyThread object.TestPtolemyThread(java.lang.Runnable target, java.lang.String name)
Construct a new TestPtolemyThread object.TestPtolemyThread(java.lang.String name)
Construct a new TestPtolemyThread object.TestPtolemyThread(java.lang.ThreadGroup group, java.lang.Runnable target)
Construct a new TestPtolemyThread object.TestPtolemyThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
Construct a new TestPtolemyThread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group.TestPtolemyThread(java.lang.ThreadGroup group, java.lang.String name)
Construct a new TestPtolemyThread object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(java.lang.String message)
Send a debug message to all debug listeners that have registered.void
debug(DebugEvent event)
Send a debug event to all debug listeners that have registered.-
Methods inherited from class ptolemy.kernel.util.PtolemyThread
_debug, _debug, addDebugListener, removeDebugListener
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
TestPtolemyThread
public TestPtolemyThread()
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(null, null, generatedName), where generatedName is a newly generated name. Automatically generated names are of the form "Thread-"+n, where n is an integer.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.Runnable target)
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(null, target, generatedName), where generatedName is a newly generated name. Automatically generated names are of the form "Thread-"+n, where n is an integer.- Parameters:
target
- The object whose run method is called.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.Runnable target, java.lang.String name)
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(null, target, name)- Parameters:
target
- The object whose run method is called.name
- The name of the new thread.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.String name)
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(null, null, name)- Parameters:
name
- The name of the new thread.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.ThreadGroup group, java.lang.Runnable target)
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(group, target, generatedName), where generatedName is a newly generated name. Automatically generated names are of the form "Thread-"+n, where n is an integer.- Parameters:
group
- The thread grouptarget
- The object whose run method is called.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)
Construct a new TestPtolemyThread object so that it has target as its run object, has the specified name as its name, and belongs to the thread group referred to by group.- Parameters:
group
- The thread group.target
- The object whose run method is called.name
- The name of the new thread.- Throws:
java.lang.SecurityException
- If the superclass constructor throws it.
-
TestPtolemyThread
public TestPtolemyThread(java.lang.ThreadGroup group, java.lang.String name)
Construct a new TestPtolemyThread object. This constructor has the same effect as TestPtolemyThread(group, null, name).- Parameters:
group
- The thread group.name
- The name of the new thread.
-
-
Method Detail
-
debug
public void debug(DebugEvent event)
Send a debug event to all debug listeners that have registered. TestPtolemyThread exists solely because in the parent class _debug() is protected- Parameters:
event
- The event.
-
debug
public void debug(java.lang.String message)
Send a debug message to all debug listeners that have registered. By convention, messages should not include a newline at the end. The newline will be added by the listener, if appropriate. Note that using this method could be fairly expensive if the message is constructed from parts, and that this expense will be incurred regardless of whether there are actually any debug listeners. Thus, you should avoid, if possible, constructing the message from parts.- Parameters:
message
- The message.- Since:
- Ptolemy II 2.3
-
-