Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.turbine.services.schedule
Class TurbineNonPersistentSchedulerService  view TurbineNonPersistentSchedulerService download TurbineNonPersistentSchedulerService.java

java.lang.Object
  extended byorg.apache.turbine.services.BaseInitable
      extended byorg.apache.turbine.services.BaseService
          extended byorg.apache.turbine.services.TurbineBaseService
              extended byorg.apache.turbine.services.schedule.TurbineSchedulerService
                  extended byorg.apache.turbine.services.schedule.TurbineNonPersistentSchedulerService
All Implemented Interfaces:
org.apache.turbine.services.Initable, ScheduleService, org.apache.turbine.services.Service

public class TurbineNonPersistentSchedulerService
extends TurbineSchedulerService

Service for a cron like scheduler that uses the TurbineResources.properties file instead of the database. The methods that operate on jobs ( get,add,update,remove ) only operate on the queue in memory and changes are not reflected to the properties file which was used to initilize the jobs. An example is given below. The job names are the class names that extend ScheduledJob.


 services.SchedulerService.scheduler.jobs=scheduledJobName,scheduledJobName2

 services.SchedulerService.scheduler.job.scheduledJobName.ID=1
 services.SchedulerService.scheduler.job.scheduledJobName.SECOND=-1
 services.SchedulerService.scheduler.job.scheduledJobName.MINUTE=-1
 services.SchedulerService.scheduler.job.scheduledJobName.HOUR=7
 services.SchedulerService.scheduler.job.scheduledJobName.WEEKDAY=-1
 services.SchedulerService.scheduler.job.scheduledJobName.DAY_OF_MONTH=-1

 services.SchedulerService.scheduler.job.scheduledJobName2.ID=1
 services.SchedulerService.scheduler.job.scheduledJobName2.SECOND=-1
 services.SchedulerService.scheduler.job.scheduledJobName2.MINUTE=-1
 services.SchedulerService.scheduler.job.scheduledJobName2.HOUR=7
 services.SchedulerService.scheduler.job.scheduledJobName2.WEEKDAY=-1
 services.SchedulerService.scheduler.job.scheduledJobName2.DAY_OF_MONTH=-1

 
Based on TamboraSchedulerService written by John Thorhauer.

Version:
$Id: TurbineNonPersistentSchedulerService.java 264148 2005-08-29 14:21:04Z henning $

Nested Class Summary
 
Nested classes inherited from class org.apache.turbine.services.schedule.TurbineSchedulerService
TurbineSchedulerService.MainLoop
 
Field Summary
private static org.apache.commons.logging.Log log
          Logging
 
Fields inherited from class org.apache.turbine.services.schedule.TurbineSchedulerService
mainLoop, scheduleQueue, thread
 
Fields inherited from class org.apache.turbine.services.BaseService
configuration, name, serviceBroker
 
Fields inherited from class org.apache.turbine.services.BaseInitable
initableBroker, isInitialized
 
Fields inherited from interface org.apache.turbine.services.schedule.ScheduleService
INTIALLY_ACTIVE, LOGGER_NAME, SERVICE_NAME
 
Constructor Summary
TurbineNonPersistentSchedulerService()
          Constructor.
 
Method Summary
 void addJob(JobEntry je)
          Add a new job to the queue.
 JobEntry getJob(int oid)
          This method returns the job element from the internal queue.
 void init()
          Called the first time the Service is used.
Load all the jobs from cold storage.
 void init(javax.servlet.ServletConfig config)
          Deprecated. use init() instead.
 void removeJob(JobEntry je)
          Remove a job from the queue.
 void updateJob(JobEntry je)
          Add/update a job
 
Methods inherited from class org.apache.turbine.services.schedule.TurbineSchedulerService
getThread, isEnabled, listJobs, restart, setEnabled, shutdown, startScheduler, stopScheduler
 
Methods inherited from class org.apache.turbine.services.TurbineBaseService
init, init
 
Methods inherited from class org.apache.turbine.services.BaseService
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
 
Methods inherited from class org.apache.turbine.services.BaseInitable
getInit, getInitableBroker, setInit, setInitableBroker
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.turbine.services.Service
getConfiguration, getName, getProperties, setName, setServiceBroker
 
Methods inherited from interface org.apache.turbine.services.Initable
getInit, init, setInitableBroker
 

Field Detail

log

private static org.apache.commons.logging.Log log
Logging

Constructor Detail

TurbineNonPersistentSchedulerService

public TurbineNonPersistentSchedulerService()
                                     throws org.apache.turbine.util.TurbineException
Constructor.

Method Detail

init

public void init()
          throws org.apache.turbine.services.InitializationException
Called the first time the Service is used.
Load all the jobs from cold storage. Add jobs to the queue (sorted in ascending order by runtime) and start the scheduler thread.

Specified by:
init in interface org.apache.turbine.services.Initable
Overrides:
init in class TurbineSchedulerService

init

public void init(javax.servlet.ServletConfig config)
          throws org.apache.turbine.services.InitializationException
Deprecated. use init() instead.

Called the first time the Service is used.
Load all the jobs from cold storage. Add jobs to the queue (sorted in ascending order by runtime) and start the scheduler thread.

Overrides:
init in class TurbineSchedulerService

getJob

public JobEntry getJob(int oid)
                throws org.apache.turbine.util.TurbineException
This method returns the job element from the internal queue.

Specified by:
getJob in interface ScheduleService
Overrides:
getJob in class TurbineSchedulerService

addJob

public void addJob(JobEntry je)
            throws org.apache.turbine.util.TurbineException
Add a new job to the queue.

Specified by:
addJob in interface ScheduleService
Overrides:
addJob in class TurbineSchedulerService

removeJob

public void removeJob(JobEntry je)
Remove a job from the queue.

Specified by:
removeJob in interface ScheduleService
Overrides:
removeJob in class TurbineSchedulerService

updateJob

public void updateJob(JobEntry je)
               throws org.apache.turbine.util.TurbineException
Add/update a job

Specified by:
updateJob in interface ScheduleService
Overrides:
updateJob in class TurbineSchedulerService