com.h3c.util.concurrent

## Interface ThreadMonitor.ThreadListener

- All Known Implementing Classes:
    LoggerThreadListener
  Enclosing class:
    ThreadMonitor

      public static interface ThreadMonitor.ThreadListener

  Thread listener.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `executing(Collection<ThreadMonitor.ThreadExecutionState> states)` Callback method to notify a snapshot of the active threads in execution.
    `void` | `failed(ThreadMonitor.ThreadExecutionState state, Exception failure)` Callback method to notify a thread has failed and the exception was not caught.
    `void` | `finished(ThreadMonitor.ThreadExecutionState state)` Callback method to notify a thread has finished execution.
    `void` | `overlapped(ThreadMonitor.ThreadExecutionState state, javax.measure.Measurable<javax.measure.quantity.Duration> period)` Callback method to notify when a `Runnable` is submitted to be executed at a fixed rate but it took more time to execute than its period.
    `void` | `started(ThreadMonitor.ThreadExecutionState state)` Callback method to notify a thread has started execution.

- - ### Method Detail

    - #### started

          void started(ThreadMonitor.ThreadExecutionState state)

      Callback method to notify a thread has started execution.

      Note: ThreadExecutionState's end time is updated by the executing thread, so by the moment the state is processed the thread might have finished execution.

      Parameters:
        `state` - thread execution state

    - #### finished

          void finished(ThreadMonitor.ThreadExecutionState state)

      Callback method to notify a thread has finished execution. This method could be used to track threads that take too long to execute.
      Parameters:
        `state` - thread execution state

    - #### executing

          void executing(Collection<ThreadMonitor.ThreadExecutionState> states)

      Callback method to notify a snapshot of the active threads in execution. This method could be used to track threads spending too long in execution state (Potentially in deadlock).

      Note: ThreadExecutionState's end time is updated by the executing thread, so by the moment the state is processed the thread might have finished execution.

      Parameters:
        `states` - threads execution states

    - #### overlapped

          void overlapped(ThreadMonitor.ThreadExecutionState state,
                        javax.measure.Measurable<javax.measure.quantity.Duration> period)

      Callback method to notify when a `Runnable` is submitted to be executed at a fixed rate but it took more time to execute than its period.
      Parameters:
        `state` - thread execution state
        `period` - period the `Runnable` was scheduled with.

    - #### failed

          void failed(ThreadMonitor.ThreadExecutionState state,
                    Exception failure)

      Callback method to notify a thread has failed and the exception was not caught.
      Parameters:
        `state` - thread execution state
        `failure` - failure

Copyright © 2014. All Rights Reserved.