Interface ThreadsData
- All Superinterfaces:
HealthCenterData,NotificationBroadcaster,NotificationEmitter
- All Known Implementing Classes:
ThreadsDataImpl
This class represents a snapshot of all the threads in the monitored
application and their current status
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidaddThreadListener(ThreadEventListener listener) Add a listener for notification of when a thread event occursbooleanReturns whether a deadlock scenario has been detected in the monitored threads.Returns all the threads in the monitored application over time.Returns the latest set of threads in the monitored application.Returns the number of threads in the application over time.Returns all the threads that are currently in the monitored application.voidremoveThreadListener(ThreadEventListener listener) Remove one of registered listeners.Methods inherited from interface com.ibm.java.diagnostics.healthcenter.api.HealthCenterData
getAllRecommendations, getCriticalRecommendations, getHealthyRecommendations, getInformationalRecommendations, getWarningRecommendations, startNotifying, startNotifyingMethods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListenerMethods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
-
Field Details
-
THREADDATA
Used to get only Threads Data when comparing againstNotificationListener.getUserData()- See Also:
-
THREADSCOUNTDATA
Used to get only Threads Count Data when comparing againstNotificationListener.getUserData()- See Also:
-
-
Method Details
-
getThreads
ThreadData[] getThreads()Returns all the threads that are currently in the monitored application. NOTE If running in "event only" mode, this data will always return an empty array. This is because "event only" does not store any data to inquire on. Instead, you need to use the api calls to register listeners and get notification of when events occur- Returns:
- an array of ThreadData objects containing the current threads
-
getThreadCounts
CountData[] getThreadCounts()Returns the number of threads in the application over time. NOTE If running in "event only" mode, this data will always return an empty array. This is because "event only" does not store any data to inquire on. Instead, you need to use the api calls to register listeners and get notification of when events occur- Returns:
- an array of CountData objects. Each object contains a time and the number of threads that were in the monitored application at that time.
-
deadlockDetected
boolean deadlockDetected()Returns whether a deadlock scenario has been detected in the monitored threads.- Returns:
trueif a deadlock scenario has been detected, otherwisefalse.
-
getLatestThreads
ThreadData[] getLatestThreads()Returns the latest set of threads in the monitored application. NOTE If running in "event only" mode, this data will always return an empty array. This is because "event only" does not store any data to inquire on. Instead, you need to use the api calls to register listeners and get notification of when events occur- Returns:
- an array of ThreadData objects containing the latest threads
-
getAllThreads
HashMap<Long,ThreadData[]> getAllThreads()Returns all the threads in the monitored application over time.- Returns:
- a HashMap containing the time of the thread snapshot and an array of ThreadData objects
-
addThreadListener
Add a listener for notification of when a thread event occurs- Parameters:
implementation- of the ThreadEventListener class
-
removeThreadListener
Remove one of registered listeners.- Parameters:
implementation- of the ThreadEventListener class
-