Interface IMonitorInfoProvider
- All Known Implementing Classes:
MonitorInfoAdapter
public interface IMonitorInfoProvider
Thread monitoring details used by the static
monitor() method as well as the more
complex ThreadMonitor objects.
See the adapter implementation MonitorInfoAdapter.
-
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.
-
Method Details
-
setTimeout
void setTimeout(long millis) 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.- Parameters:
millis- timeout in milliseconds;<= 0means no timeout
-
getTimeout
long getTimeout()Get the current timeout value.- Returns:
- timeout in milliseconds, or a non-positive value for no timeout
-
setProbingPeriod
void setProbingPeriod(long millis) 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.- Parameters:
millis- period in milliseconds;<= 0means a default value will be used
-
getProbingPeriod
long getProbingPeriod()Get the current probing period.- Returns:
- the period in ms
-
onInterrupt
void onInterrupt()If timeout has elapsed, this method is called before the monitor attempts to interrupt the monitored thread.
-