railo.runtime.schedule
Class SchedulerImpl

java.lang.Object
  extended by railo.runtime.schedule.SchedulerImpl
All Implemented Interfaces:
Scheduler

public final class SchedulerImpl
extends Object
implements Scheduler

scheduler class to execute the scheduled tasks


Constructor Summary
SchedulerImpl(CFMLEngine engine, Config config, Resource schedulerDir, LogAndSource log, String charset)
          constructor of the sheduler
SchedulerImpl(CFMLEngine engine, String xml, Config config, LogAndSource log)
          creates a empty Scheduler, used for event gateway context
 
Method Summary
 void addScheduleTask(ScheduleTask task, boolean allowOverwrite)
          Adds a Task to the scheduler
 void execute(ScheduleTask task)
           
 ScheduleTask[] getAllScheduleTasks()
          returns all schedule tasks valid or not
 LogAndSource getLogger()
           
 ScheduleTask getScheduleTask(String name)
          returns a schedule tasks matching given name or throws a exception
 ScheduleTask getScheduleTask(String name, ScheduleTask defaultValue)
          returns a schedule tasks matching given name or null
 void pauseScheduleTask(String name, boolean pause, boolean throwWhenNotExist)
          pause the scheduler task
 void removeIfNoLonerValid(ScheduleTask task)
           
 void removeScheduleTask(String name, boolean throwWhenNotExist)
          removes a task from scheduler
 void runScheduleTask(String name, boolean throwWhenNotExist)
          runs a scheduler task
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchedulerImpl

public SchedulerImpl(CFMLEngine engine,
                     Config config,
                     Resource schedulerDir,
                     LogAndSource log,
                     String charset)
              throws SAXException,
                     IOException,
                     PageException
constructor of the sheduler

Parameters:
config -
schedulerDir - schedule file
log -
Throws:
IOException
SAXException
PageException

SchedulerImpl

public SchedulerImpl(CFMLEngine engine,
                     String xml,
                     Config config,
                     LogAndSource log)
creates a empty Scheduler, used for event gateway context

Parameters:
engine -
config -
log -
Throws:
SAXException
IOException
PageException
Method Detail

getScheduleTask

public ScheduleTask getScheduleTask(String name)
                             throws ScheduleException
Description copied from interface: Scheduler
returns a schedule tasks matching given name or throws a exception

Specified by:
getScheduleTask in interface Scheduler
Parameters:
name - Task name of Schedule Task to get
Returns:
matching task
Throws:
ScheduleException

getScheduleTask

public ScheduleTask getScheduleTask(String name,
                                    ScheduleTask defaultValue)
Description copied from interface: Scheduler
returns a schedule tasks matching given name or null

Specified by:
getScheduleTask in interface Scheduler
Parameters:
name - Task name of Schedule Task to get
Returns:
matching task

getAllScheduleTasks

public ScheduleTask[] getAllScheduleTasks()
Description copied from interface: Scheduler
returns all schedule tasks valid or not

Specified by:
getAllScheduleTasks in interface Scheduler
Returns:
all tasks

addScheduleTask

public void addScheduleTask(ScheduleTask task,
                            boolean allowOverwrite)
                     throws ScheduleException,
                            IOException
Description copied from interface: Scheduler
Adds a Task to the scheduler

Specified by:
addScheduleTask in interface Scheduler
Throws:
ScheduleException
IOException

pauseScheduleTask

public void pauseScheduleTask(String name,
                              boolean pause,
                              boolean throwWhenNotExist)
                       throws ScheduleException,
                              IOException
Description copied from interface: Scheduler
pause the scheduler task

Specified by:
pauseScheduleTask in interface Scheduler
Throws:
ScheduleException
IOException

removeScheduleTask

public void removeScheduleTask(String name,
                               boolean throwWhenNotExist)
                        throws IOException,
                               ScheduleException
Description copied from interface: Scheduler
removes a task from scheduler

Specified by:
removeScheduleTask in interface Scheduler
Parameters:
name - name of the task to remove
throwWhenNotExist - define if method throws a exception if task doesn't exist
Throws:
IOException
ScheduleException

removeIfNoLonerValid

public void removeIfNoLonerValid(ScheduleTask task)
                          throws IOException
Throws:
IOException

runScheduleTask

public void runScheduleTask(String name,
                            boolean throwWhenNotExist)
                     throws IOException,
                            ScheduleException
Description copied from interface: Scheduler
runs a scheduler task

Specified by:
runScheduleTask in interface Scheduler
Throws:
IOException
ScheduleException

execute

public void execute(ScheduleTask task)

getLogger

public LogAndSource getLogger()
Specified by:
getLogger in interface Scheduler
Returns:
Returns the logFile.


Copyright © 2012 Railo