Class Monitor
java.lang.Object
org.eclipse.net4j.util.om.monitor.AbstractMonitor
org.eclipse.net4j.util.om.monitor.Monitor
- All Implemented Interfaces:
OMMonitor, OMMonitorProgress
- Direct Known Subclasses:
EclipseMonitor, NotifyingMonitor, TimeoutMonitor
- Since:
- 2.0
- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMonitor
AbstractMonitor.AsyncTimerTaskNested classes/interfaces inherited from interface OMMonitor
OMMonitor.Async, OMMonitor.AsyncMonitor -
Field Summary
FieldsFields inherited from interface OMMonitor
DEFAULT_TIME_FACTOR, THOUSANDFields inherited from interface OMMonitorProgress
HUNDRED, ONE, TEN, ZERO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()voidcancel(RuntimeException cancelException) voidprotected longprotected TimergetTimer()booleanprotected final booleanReturns the cancellation flag without applying subclass-specific observation side effects.static TimerTaskscheduleAtFixedRate(Runnable task, long delay, long period) Schedules a periodic task on the shared daemon timer used by monitors.protected voidscheduleAtFixedRate(TimerTask task, long delay, long period) Methods inherited from class AbstractMonitor
begin, begin, createAsyncTimerTask, createNestedMonitor, done, fork, fork, forkAsync, forkAsync, getTotalWork, getWork, getWorkPercent, hasBegun, percent, worked, worked
-
Field Details
-
DEFAULT_ASYNC_SCHEDULE_PERIOD
public static final long DEFAULT_ASYNC_SCHEDULE_PERIOD- See Also:
-
-
Constructor Details
-
Monitor
public Monitor()
-
-
Method Details
-
cancel
public void cancel() -
cancel
-
isCanceled
public boolean isCanceled() -
checkCanceled
- Throws:
MonitorCanceledException
-
isCanceledState
protected final boolean isCanceledState()Returns the cancellation flag without applying subclass-specific observation side effects.- Returns:
- whether this monitor has been canceled
- Since:
- 3.31
-
getAsyncSchedulePeriod
protected long getAsyncSchedulePeriod()- Specified by:
getAsyncSchedulePeriodin classAbstractMonitor
-
scheduleAtFixedRate
- Specified by:
scheduleAtFixedRatein classAbstractMonitor
-
getTimer
- Specified by:
getTimerin classAbstractMonitor
-
scheduleAtFixedRate
Schedules a periodic task on the shared daemon timer used by monitors. Task failures are logged and do not terminate the timer thread. Scheduling failures are logged and leave the returned task unscheduled. Canceled tasks remain in the timer queue until their scheduled time is reached.- Parameters:
task- the task to rundelay- the delay before the first execution in millisecondsperiod- the period between executions in milliseconds- Returns:
- the scheduled task, which can be canceled to stop further executions
- Throws:
NullPointerException- iftaskisnull- Since:
- 3.31
-