org.norther.tammi.core.thread
Interface Scheduler

All Superinterfaces:
ScheduledTimer, Startable
All Known Implementing Classes:
DefaultScheduler, DefaultTimeout

public interface Scheduler
extends Startable, ScheduledTimer

An interface to schedulers to execute runnable commands as scheduled tasks. The scheduler itself runs in a background thread created by the specified thread factory. The scheduled tasks are executed by the specified executer, which may execute the tasks in the same thread, in separate threads or in a thread pool, depending on its configuration. Typically, the same command may run only in one thread at the time, so the execution period should be longer than the expected execution time of the command.

An idle command can also be scheduled and will be executed whenever there are not other active tasks.

Version:
$Id: Scheduler.java,v 1.14 2009/09/28 15:08:43 cvsimp Exp $
Author:
Ilkka Priha

Method Summary
 ObjectName getExecutorName()
          Gets the the executor of this scheduler.
 ObjectName getThreadFactoryName()
          Gets the thread factory of this scheduler.
 void setExecutorName(ObjectName executor)
          Sets the executor of this scheduler.
 void setThreadFactoryName(ObjectName factory)
          Sets the thread factory of this scheduler.
 
Methods inherited from interface org.norther.tammi.core.base.Startable
isStarted, start, stop
 
Methods inherited from interface org.norther.tammi.acorn.util.concurrent.ScheduledTimer
executeAfterDelay, executeAfterDelay, executeAt, executeAt, executePeriodically, executePeriodically, executePeriodically, getIdleCommand, getIdleDelay, isIdleSupported, setIdleCommand, setIdleDelay, start, stop
 

Method Detail

getThreadFactoryName

ObjectName getThreadFactoryName()
Gets the thread factory of this scheduler.

Returns:
the name of the factory or a query.

setThreadFactoryName

void setThreadFactoryName(ObjectName factory)
Sets the thread factory of this scheduler.

Parameters:
factory - the name of the factory or a query.

getExecutorName

ObjectName getExecutorName()
Gets the the executor of this scheduler.

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

setExecutorName

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

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


Copyright © 2004 The Norther Organization. All rights reserved.