org.apache.turbine.services.schedule

## Class TurbineNonPersistentSchedulerService

- java.lang.Object
- - org.apache.turbine.services.BaseInitable
  - - org.apache.turbine.services.BaseService
    - - org.apache.turbine.services.TurbineBaseService
      - - org.apache.turbine.services.schedule.AbstractSchedulerService
        - - org.apache.turbine.services.schedule.TurbineNonPersistentSchedulerService

- All Implemented Interfaces:
    Initable, ScheduleService, Service

  Deprecated.
  Use QuartzSchedulerService instead

      @Deprecated
      public class TurbineNonPersistentSchedulerService
      extends AbstractSchedulerService

  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 initialize 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 534527 2007-05-02 16:10:59Z tv $
  Author:
    Jeff Brekke, John Thorhauer, Quinton McCombs

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.turbine.services.schedule.AbstractSchedulerService

      `AbstractSchedulerService.MainLoop`

  - ### Field Summary

    - ### Fields inherited from class org.apache.turbine.services.schedule.AbstractSchedulerService

      `enabled, log, 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

    Constructors
    Constructor and Description
    `TurbineNonPersistentSchedulerService()` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JobEntry` | `getJob(int oid)` Deprecated. This method returns the job element from the internal queue.
    `protected List<? extends JobEntry>` | `loadJobs()` Deprecated. Load all jobs from configuration storage
    `JobEntry` | `newJob(int sec, int min, int hour, int wd, int day_mo, String task)` Deprecated. Factory method for a new Job Schedule a job to run on a certain point of time.
    `void` | `removeJob(JobEntry je)` Deprecated. Remove a job from the queue.
    `void` | `updateJob(JobEntry je)` Deprecated. Add/update a job

    - ### Methods inherited from class org.apache.turbine.services.schedule.AbstractSchedulerService

      `addJob, clearThread, getThread, init, isEnabled, listJobs, nextJob, 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`

- - ### Constructor Detail

    - #### TurbineNonPersistentSchedulerService

          public TurbineNonPersistentSchedulerService()

      Deprecated.

  - ### Method Detail

    - #### loadJobs

          protected List<? extends JobEntry> loadJobs()
                                               throws TurbineException

      Deprecated.
      Description copied from class: `AbstractSchedulerService`
      Load all jobs from configuration storage
      Specified by:
        `loadJobs` in class `AbstractSchedulerService`
      Returns:
        the list of pre-configured jobs
      Throws:
        `TurbineException` - if jobs could not be loaded
      See Also:
        `AbstractSchedulerService.loadJobs()`

    - #### newJob

          public JobEntry newJob(int sec,
                        int min,
                        int hour,
                        int wd,
                        int day_mo,
                        String task)
                          throws TurbineException

      Deprecated.
      Description copied from interface: `ScheduleService`
      Factory method for a new Job Schedule a job to run on a certain point of time.
      Example 1: Run the DefaultScheduledJob at 8:00am every 15th of the month -
      JobEntry je = newJob(0,0,8,-1,15,"DefaultScheduledJob");
      Example 2: Run the DefaultScheduledJob at 8:00am every day -
      JobEntry je = newJob(0,0,8,-1,-1,"DefaultScheduledJob");
      Example 3: Run the DefaultScheduledJob every 2 hours. -
      JobEntry je = newJob(0,120,-1,-1,-1,"DefaultScheduledJob");
      Example 4: Run the DefaultScheduledJob every 30 seconds. -
      JobEntry je = newJob(30,-1,-1,-1,-1,"DefaultScheduledJob");
      Specified by:
        `newJob` in interface `ScheduleService`
      Specified by:
        `newJob` in class `AbstractSchedulerService`
      Parameters:
        `sec` - Value for entry "seconds".
        `min` - Value for entry "minutes".
        `hour` - Value for entry "hours".
        `wd` - Value for entry "week days".
        `day_mo` - Value for entry "month days".
        `task` - Task to execute.
      Returns:
        A JobEntry.
      Throws:
        `TurbineException` - could not create job
      See Also:
        `ScheduleService.newJob(int, int, int, int, int, java.lang.String)`

    - #### getJob

          public JobEntry getJob(int oid)
                          throws TurbineException

      Deprecated.
      This method returns the job element from the internal queue.
      Specified by:
        `getJob` in interface `ScheduleService`
      Specified by:
        `getJob` in class `AbstractSchedulerService`
      Parameters:
        `oid` - The int id for the job.
      Returns:
        A JobEntry.
      Throws:
        `TurbineException` - could not retrieve job

    - #### removeJob

          public void removeJob(JobEntry je)

      Deprecated.
      Remove a job from the queue.
      Specified by:
        `removeJob` in interface `ScheduleService`
      Specified by:
        `removeJob` in class `AbstractSchedulerService`
      Parameters:
        `je` - A JobEntry with the job to remove.

    - #### updateJob

          public void updateJob(JobEntry je)
                         throws TurbineException

      Deprecated.
      Add/update a job
      Specified by:
        `updateJob` in interface `ScheduleService`
      Specified by:
        `updateJob` in class `AbstractSchedulerService`
      Parameters:
        `je` - A JobEntry with the job to modify
      Throws:
        `TurbineException` - job could not be updated

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.