|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.byteman.rule.helper.Helper
org.jboss.byteman.sample.helper.ThreadHistoryMonitorHelper
public class ThreadHistoryMonitorHelper
Helper class used by ThreadHistoryMonitorHelper script to trace thread operations. This is essentially an extension of the ThreadMonitorHelper which uses maps to store the thread history rather than writing it out. The helper also implements ThreadHistoryMonitorHelperMXBean to allow this class to be registered as an mbean @see #registerHelperMBean(String).
Field Summary |
---|
Fields inherited from class org.jboss.byteman.rule.helper.Helper |
---|
rule |
Constructor Summary | |
---|---|
protected |
ThreadHistoryMonitorHelper(Rule rule)
|
Method Summary | |
---|---|
static void |
activated()
Looks to the org.jboss.byteman.sample.helper.debug system property to set the class DEBUG mode flag. |
ThreadMonitorEvent[] |
getCreateEvents()
Get the array of thread creation events. |
java.lang.String |
getEventReport()
Get a string description of all thread events. |
ThreadMonitorEvent[] |
getExitEvents()
Get the array of thread exit events. |
ThreadMonitorEvent[] |
getRunEvents()
Get the array of Runnable.run events. |
ThreadMonitorEvent[] |
getStartEvents()
Get the array of thread start events. |
static void |
installed(Rule rule)
|
void |
registerHelperMBean(java.lang.String name)
Register the INSTANCE as an mbean under the given name. |
void |
traceCreate(java.lang.Thread thread,
int depth)
trace creation of the supplied thread to System.out this should only be triggered from the constructor for class java.lang.Thread" |
void |
traceExit(java.lang.Thread thread)
trace exit of the supplied thread to System.out this should only be triggered from the call to java.lang.Thread.exit" |
void |
traceRun(java.lang.Runnable runnable)
trace run of the supplied Runnable to System.out this should only be triggered from a call to an implementation of java.lang.Runnable.run" |
void |
traceStart(java.lang.Thread thread)
trace start of the supplied thread to System.out this should only be triggered from the call to java.lang.Thread.start" |
void |
writeAllEventsToFile(java.lang.String path)
Write all events to the file given by path |
void |
writeAllEventsToFile(java.lang.String path,
int sampleCount)
Write all events to the file given by path, repeating sampleCount times at 5 second intervals. |
void |
writeEventsToFile(java.lang.String type,
java.lang.String path)
Write a report of all events of the indicated type to the given path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ThreadHistoryMonitorHelper(Rule rule)
Method Detail |
---|
public static void activated()
public static void installed(Rule rule)
public void registerHelperMBean(java.lang.String name)
name
- - the object name string to register the INSTANCE underpublic ThreadMonitorEvent[] getCreateEvents()
ThreadHistoryMonitorHelperMXBean
getCreateEvents
in interface ThreadHistoryMonitorHelperMXBean
public ThreadMonitorEvent[] getStartEvents()
ThreadHistoryMonitorHelperMXBean
getStartEvents
in interface ThreadHistoryMonitorHelperMXBean
public ThreadMonitorEvent[] getExitEvents()
ThreadHistoryMonitorHelperMXBean
getExitEvents
in interface ThreadHistoryMonitorHelperMXBean
public ThreadMonitorEvent[] getRunEvents()
ThreadHistoryMonitorHelperMXBean
getRunEvents
in interface ThreadHistoryMonitorHelperMXBean
public java.lang.String getEventReport() throws java.io.IOException
ThreadHistoryMonitorHelperMXBean
ThreadHistoryMonitorHelperMXBean.writeAllEventsToFile(String)
.
getEventReport
in interface ThreadHistoryMonitorHelperMXBean
java.io.IOException
public void writeEventsToFile(java.lang.String type, java.lang.String path) throws java.io.IOException
ThreadHistoryMonitorHelperMXBean
writeEventsToFile
in interface ThreadHistoryMonitorHelperMXBean
type
- - one of create, start, exit, run; case insensitivepath
- - the pathname of the file to write the event report to.
java.io.IOException
public void writeAllEventsToFile(java.lang.String path) throws java.io.IOException
writeAllEventsToFile
in interface ThreadHistoryMonitorHelperMXBean
path
-
java.io.IOException
public void writeAllEventsToFile(java.lang.String path, int sampleCount) throws java.io.IOException
path
- - the path to the event report filesampleCount
- - the number of samples to take
java.io.IOException
- - thrown on any IO failurepublic void traceCreate(java.lang.Thread thread, int depth)
thread
- the newly created threadpublic void traceStart(java.lang.Thread thread)
thread
- the newly starting threadpublic void traceExit(java.lang.Thread thread)
thread
- the exiting threadpublic void traceRun(java.lang.Runnable runnable)
runnable
- the runnable being run
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |