SystemTimeInterruptMonitor

SystemTimeInterruptMonitor class

Simple implementation of AbstractInterruptMonitor by checking and comparing current system time with user specified limit.

class SystemTimeInterruptMonitor;

Remarks

This implementation is just a simple solution for simple scenarios. It needs to frequently retrieve and check the system time so itself may have a negative impact on performance to some extent.

Constructors

NameDescription
constructor(boolean)Constructs one interruption monitor.

Methods

MethodDescription
isInterruptionRequested()This implementation just checks whether the time cost(from the time when starting this monitor to now) is greater than user specified limit.
getTerminateWithoutException()See AbstractInterruptMonitor.TerminateWithoutException. This property is specified by user when constructing this monitor instance.
startMonitor(number)Starts the monitor with the specified time limit. The start time to calculate time cost is just when this method is called, so the procedure which needs to be monitored should be started just after this call.
isNull()Checks whether the implementation object is null.

constructor(boolean)

Constructs one interruption monitor.

constructor(terminateWithoutException: boolean);

Parameters:

ParameterTypeDescription
terminateWithoutExceptionbooleanAbstractInterruptMonitor.TerminateWithoutException

isInterruptionRequested()

This implementation just checks whether the time cost(from the time when starting this monitor to now) is greater than user specified limit.

isInterruptionRequested() : boolean;

getTerminateWithoutException()

See AbstractInterruptMonitor.TerminateWithoutException. This property is specified by user when constructing this monitor instance.

getTerminateWithoutException() : boolean;

startMonitor(number)

Starts the monitor with the specified time limit. The start time to calculate time cost is just when this method is called, so the procedure which needs to be monitored should be started just after this call.

startMonitor(msLimit: number) : void;

Parameters:

ParameterTypeDescription
msLimitnumbertime limit(ms) to require the interruption.

isNull()

Checks whether the implementation object is null.

isNull() : boolean;