org.opennms.netmgt.scheduler
Interface Scheduler

All Superinterfaces:
ScheduleTimer, Timer
All Known Implementing Classes:
LegacyScheduler

public interface Scheduler
extends ScheduleTimer


Method Summary
 long getCurrentTime()
          This returns the current time for the scheduler
 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)
          This method is used to schedule a ready runnable in the system.
 void start()
          Starts the fiber.
 void stop()
          Stops the fiber.
 

Method Detail

schedule

void schedule(long interval,
              ReadyRunnable runnable)
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 interface ScheduleTimer
Parameters:
interval - The queue to add the runnable to.
runnable - The element to run when interval expires.
Throws:
RuntimeException - Thrown if an error occurs adding the element to the queue.

getCurrentTime

long getCurrentTime()
This returns the current time for the scheduler

Specified by:
getCurrentTime in interface Timer

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.


Copyright © 2009. All Rights Reserved.