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 Details

    • MonitorInfoAdapter

      public MonitorInfoAdapter(long timeout, long probingPeriod)
  • 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 - can be <=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:
    • 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 - if <=0, then will use a default sane value
    • getProbingPeriod

      public long getProbingPeriod()
      Description copied from interface: IMonitorInfoProvider
      Get the current probing period.
      Specified by:
      getProbingPeriod in interface IMonitorInfoProvider
      Returns:
    • 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