Class MonitorInfoAdapter
java.lang.Object
com.pnfsoftware.jeb.util.concurrent.MonitorInfoAdapter
- All Implemented Interfaces:
IMonitorInfoProvider
Standard implementation of the
IMonitorInfoProvider interface.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongGet the current probing period.longGet the current timeout value.voidIf timeout has elapsed, this method is called before the monitor attempts to interrupt the monitored thread.voidsetProbingPeriod(long millis) Set the period at which the monitored thread will be probed.voidsetTimeout(long millis) Set the timeout value that determines the maximum thread's lifetime.
-
Constructor Details
-
MonitorInfoAdapter
public MonitorInfoAdapter(long timeout, long probingPeriod)
-
-
Method Details
-
setTimeout
public void setTimeout(long millis) Description copied from interface:IMonitorInfoProviderSet 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:
setTimeoutin interfaceIMonitorInfoProvider- Parameters:
millis- can be <=0, means no timeout
-
getTimeout
public long getTimeout()Description copied from interface:IMonitorInfoProviderGet the current timeout value.- Specified by:
getTimeoutin interfaceIMonitorInfoProvider- Returns:
-
setProbingPeriod
public void setProbingPeriod(long millis) Description copied from interface:IMonitorInfoProviderSet 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:
setProbingPeriodin interfaceIMonitorInfoProvider- Parameters:
millis- if <=0, then will use a default sane value
-
getProbingPeriod
public long getProbingPeriod()Description copied from interface:IMonitorInfoProviderGet the current probing period.- Specified by:
getProbingPeriodin interfaceIMonitorInfoProvider- Returns:
-
onInterrupt
public void onInterrupt()Description copied from interface:IMonitorInfoProviderIf timeout has elapsed, this method is called before the monitor attempts to interrupt the monitored thread.- Specified by:
onInterruptin interfaceIMonitorInfoProvider
-