All Implemented Interfaces:
HealthCenterData, ThreadsData, NotificationBroadcaster, NotificationEmitter

public class ThreadsDataImpl extends HealthCenterDataImpl implements ThreadsData
  • Constructor Details

    • ThreadsDataImpl

      public ThreadsDataImpl(com.ibm.java.diagnostics.common.datamodel.data.Data data)
  • Method Details

    • getLatestThreads

      public ThreadData[] getLatestThreads()
      Description copied from interface: ThreadsData
      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
      Specified by:
      getLatestThreads in interface ThreadsData
      Returns:
      an array of ThreadData objects containing the latest threads
    • getThreads

      public ThreadData[] getThreads()
      Description copied from interface: ThreadsData
      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
      Specified by:
      getThreads in interface ThreadsData
      Returns:
      an array of ThreadData objects containing the current threads
    • getThreadCounts

      public CountData[] getThreadCounts()
      Description copied from interface: ThreadsData
      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
      Specified by:
      getThreadCounts in interface ThreadsData
      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.
    • getRecommendationLabel

      protected String getRecommendationLabel()
      Specified by:
      getRecommendationLabel in class HealthCenterDataImpl
    • getSubsystemLabel

      protected String getSubsystemLabel()
      Specified by:
      getSubsystemLabel in class HealthCenterDataImpl
    • deadlockDetected

      public boolean deadlockDetected()
      Description copied from interface: ThreadsData
      Returns whether a deadlock scenario has been detected in the monitored threads.
      Specified by:
      deadlockDetected in interface ThreadsData
      Returns:
      true if a deadlock scenario has been detected, otherwise false.
    • startNotifying

      public void startNotifying()
      Description copied from interface: HealthCenterData
      Starts a thread which checks for changes in the data every 2000 milliseconds and sends notifications if an update has occurred. To handle these notifications, a NotificationListener needs to be added to the object the thread is being started from.
      Specified by:
      startNotifying in interface HealthCenterData
    • startNotifying

      public void startNotifying(long delay)
      Description copied from interface: HealthCenterData
      Starts a thread which checks for changes in the data and sends notifications if an update has occurred. To handle these notifications, a NotificationListener needs to be added to the object the thread is being started from.
      Specified by:
      startNotifying in interface HealthCenterData
      Parameters:
      delay - The number of milliseconds between each update. The default is 2000 milliseconds and anything below this will not be accepted.
    • getAllThreads

      public HashMap<Long,ThreadData[]> getAllThreads()
      Description copied from interface: ThreadsData
      Returns all the threads in the monitored application over time.
      Specified by:
      getAllThreads in interface ThreadsData
      Returns:
      a HashMap containing the time of the thread snapshot and an array of ThreadData objects
    • addThreadListener

      public void addThreadListener(ThreadEventListener listener)
      Description copied from interface: ThreadsData
      Add a listener for notification of when a thread event occurs
      Specified by:
      addThreadListener in interface ThreadsData
    • removeThreadListener

      public void removeThreadListener(ThreadEventListener listener)
      Description copied from interface: ThreadsData
      Remove one of registered listeners.
      Specified by:
      removeThreadListener in interface ThreadsData