Class MonitorInfoAdapter

java.lang.Object
com.pnfsoftware.jeb.util.concurrent.MonitorInfoAdapter
All Implemented Interfaces:
IMonitorInfoProvider

public class MonitorInfoAdapter extends Object implements IMonitorInfoProvider
Standard implementation of the IMonitorInfoProvider interface.
  • Constructor Summary

    Constructors
    Constructor
    Description
    MonitorInfoAdapter(long timeout, long probingPeriodMs)
    Create monitor settings.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Get the current probing period.
    long
    Get the current timeout value.
    void
    If timeout has elapsed, this method is called before the monitor attempts to interrupt the monitored thread.
    void
    setProbingPeriod(long millis)
    Set the period at which the monitored thread will be probed.
    void
    setTimeout(long millis)
    Set the timeout value that determines the maximum thread's lifetime.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MonitorInfoAdapter

      public MonitorInfoAdapter(long timeout, long probingPeriodMs)
      Create monitor settings.
      Parameters:
      timeout - timeout in milliseconds; a non-positive value means no timeout
      probingPeriodMs - monitor probing period in milliseconds
  • Method Details

    • setTimeout

      public void setTimeout(long millis)
      Description copied from interface: IMonitorInfoProvider
      Set the timeout value that determines the maximum thread's lifetime. That method allows the timeout to be set dynamically, even during execution of said-thread.
      Specified by:
      setTimeout in interface IMonitorInfoProvider
      Parameters:
      millis - timeout in milliseconds; <= 0 means no timeout
    • getTimeout

      public long getTimeout()
      Description copied from interface: IMonitorInfoProvider
      Get the current timeout value.
      Specified by:
      getTimeout in interface IMonitorInfoProvider
      Returns:
      timeout in milliseconds, or a non-positive value for no timeout
    • setProbingPeriod

      public void setProbingPeriod(long millis)
      Description copied from interface: IMonitorInfoProvider
      Set the period at which the monitored thread will be probed. That method allows the probing period to be set dynamically, even during execution of said-thread.
      Specified by:
      setProbingPeriod in interface IMonitorInfoProvider
      Parameters:
      millis - period in milliseconds; <= 0 means a default value will be used
    • getProbingPeriod

      public long getProbingPeriod()
      Description copied from interface: IMonitorInfoProvider
      Get the current probing period.
      Specified by:
      getProbingPeriod in interface IMonitorInfoProvider
      Returns:
      the period in ms
    • onInterrupt

      public void onInterrupt()
      Description copied from interface: IMonitorInfoProvider
      If timeout has elapsed, this method is called before the monitor attempts to interrupt the monitored thread.
      Specified by:
      onInterrupt in interface IMonitorInfoProvider