com.h3c.util.concurrent

## Class ThreadMonitor.ThreadExecutionState

- java.lang.Object
- - com.h3c.util.concurrent.ThreadMonitor.ThreadExecutionState

- Enclosing class:
    ThreadMonitor

      public static class ThreadMonitor.ThreadExecutionState
      extends Object

  Thread execution state.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.measure.Measurable<javax.measure.quantity.Duration>` | `getDuration()` Gets the execution duration: time the thread spent in execution.
    `Date` | `getEndTime()` Gets the execution end time, `null` if the thread has not finished execution.
    `Date` | `getStartTime()` Gets the execution start time, `null` if the thread has not started execution (If it is queued in the thread pool).
    `Object` | `getThread()` Gets the `Runnable` or `Callable` that was submitted to be executed in a separated thread.
    `long` | `getThreadId()` Gets the thread's id.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getThreadId

          public long getThreadId()

      Gets the thread's id. This id is generated by the thread monitor and it is meant to be used to correlate notifications related to the same thread.
      Returns:
        the thread's id

    - #### getThread

          public Object getThread()

      Gets the `Runnable` or `Callable` that was submitted to be executed in a separated thread.
      Returns:
        the asynchronous task

    - #### getStartTime

          public Date getStartTime()

      Gets the execution start time, `null` if the thread has not started execution (If it is queued in the thread pool).
      Returns:
        the execution start time

    - #### getEndTime

          public Date getEndTime()

      Gets the execution end time, `null` if the thread has not finished execution.
      Returns:
        the execution end time

    - #### getDuration

          public javax.measure.Measurable<javax.measure.quantity.Duration> getDuration()

      Gets the execution duration: time the thread spent in execution.
      Returns:
        the execution duration, `null` if the threads has not finished execution

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.