org.norther.tammi.core.thread
Interface Schedulable

All Superinterfaces:
Runnable, Startable
All Known Implementing Classes:
DefaultSchedulable

public interface Schedulable
extends Startable, Runnable

An interface to schedulable objects, which can be executed in their own thread provided by a speficied scheduler.

Author:
Ilkka Priha

Method Summary
 long getDelay()
          Gets the starting delay.
 long getPeriod()
          Gets the execution period.
 ObjectName getSchedulerName()
          Gets the the scheduler of the schedulable.
 void setDelay(long delay)
          Sets the starting delay between start method invocation and actual execution.
 void setPeriod(long period)
          Sets the execution period.
 void setSchedulerName(ObjectName scheduler)
          Sets the scheduler of the schedulable.
 void setTime(long time)
          Sets the starting time of the first execution.
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getSchedulerName

ObjectName getSchedulerName()
Gets the the scheduler of the schedulable.

Returns:
the object name of the scheduler or a query.

setSchedulerName

void setSchedulerName(ObjectName scheduler)
Sets the scheduler of the schedulable. If it is not set, the default one will be used.

Note that it will be taken into use after next start.

Parameters:
scheduler - the object name of the scheduler or a query.

getPeriod

long getPeriod()
Gets the execution period.

Returns:
the execution period in msecs.

setPeriod

void setPeriod(long period)
Sets the execution period.

Note that it will be taken into use after next start.

Parameters:
period - the execution period in msecs.
Throws:
IllegalArgumentException - if period is less than or equal to zero.

getDelay

long getDelay()
Gets the starting delay.

Returns:
the starting delay in msecs.

setDelay

void setDelay(long delay)
Sets the starting delay between start method invocation and actual execution.

Parameters:
delay - the starting delay in msecs.

setTime

void setTime(long time)
Sets the starting time of the first execution.

Parameters:
time - the starting time in msecs.


Copyright © 2004 The Norther Organization. All rights reserved.