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 TypeMethodDescriptionlong
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.
-
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 interfaceIMonitorInfoProvider
- 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 interfaceIMonitorInfoProvider
- 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 interfaceIMonitorInfoProvider
- 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 interfaceIMonitorInfoProvider
- 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 interfaceIMonitorInfoProvider
-