Package org.opennms.netmgt.scheduler
Interface Scheduler
-
- All Superinterfaces:
ScheduleTimer
,Timer
- All Known Implementing Classes:
LegacyScheduler
,MockScheduler
public interface Scheduler extends ScheduleTimer
Scheduler interface.
- Version:
- $Id: $
- Author:
- ranger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getCurrentTime()
This returns the current time for the schedulerlong
getNumTasksExecuted()
Returns the total number of scheduled tasks (ReadyRunnables) that have been executed since the scheduler was initialized.int
getStatus()
Returns the current of this fiber.void
pause()
Pauses the scheduler if it is current running.void
resume()
Resumes the scheduler if it has been paused.void
schedule(long interval, ReadyRunnable runnable)
schedulevoid
start()
Starts the fiber.void
stop()
Stops the fiber.
-
-
-
Method Detail
-
schedule
void schedule(long interval, ReadyRunnable runnable)
schedule
This method is used to schedule a ready runnable in the system. The interval is used as the key for determining which queue to add the runnable.- Specified by:
schedule
in interfaceScheduleTimer
- Parameters:
interval
- a long.runnable
- aReadyRunnable
object.
-
getCurrentTime
long getCurrentTime()
This returns the current time for the scheduler- Specified by:
getCurrentTime
in interfaceTimer
- Returns:
- a long.
-
start
void start()
Starts the fiber.- Throws:
IllegalStateException
- Thrown if the fiber is already running.
-
stop
void stop()
Stops the fiber. If the fiber has never been run then an exception is generated.- Throws:
IllegalStateException
- Throws if the fiber has never been started.
-
pause
void pause()
Pauses the scheduler if it is current running. If the fiber has not been run or has already stopped then an exception is generated.- Throws:
IllegalStateException
- Throws if the operation could not be completed due to the fiber's state.
-
resume
void resume()
Resumes the scheduler if it has been paused. If the fiber has not been run or has already stopped then an exception is generated.- Throws:
IllegalStateException
- Throws if the operation could not be completed due to the fiber's state.
-
getStatus
int getStatus()
Returns the current of this fiber.- Returns:
- The current status.
-
getNumTasksExecuted
long getNumTasksExecuted()
Returns the total number of scheduled tasks (ReadyRunnables) that have been executed since the scheduler was initialized.- Returns:
- the number of task executed
-
-