org.apache.ode.bpel.iapi

## Interface Scheduler

- All Known Implementing Classes:
    MockScheduler, ReplayerScheduler, SimpleScheduler

      public interface Scheduler

  The BPEL scheduler.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `Scheduler.JobDetails`
    `static class` | `Scheduler.JobInfo` Wrapper containing information about a scheduled job.
    `static interface` | `Scheduler.JobProcessor` Interface implemented by the object responsible for job execution.
    `static class` | `Scheduler.JobProcessorException` Exception thrown by the `Scheduler.JobProcessor` to indicate failure in job processing.
    `static class` | `Scheduler.JobType`
    `static interface` | `Scheduler.MapSerializableRunnable`
    `static interface` | `Scheduler.Synchronizer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `acquireTransactionLocks()`
    `void` | `cancelJob(java.lang.String jobId)` Make a good effort to cancel the job.
    `<T> java.util.concurrent.Future<T>` | `execIsolatedTransaction(java.util.concurrent.Callable<T> transaction)` Same as execTransaction but executes in a different thread to guarantee isolation from the main execution thread.
    `<T> T` | `execTransaction(java.util.concurrent.Callable<T> transaction)` Execute a `Callable` in a transactional context.
    `<T> T` | `execTransaction(java.util.concurrent.Callable<T> transaction, int timeout)` Execute a `Callable` in a transactional context.
    `boolean` | `isTransacted()`
    `void` | `registerSynchronizer(Scheduler.Synchronizer synch)` Register a transaction synchronizer.
    `java.lang.String` | `scheduleMapSerializableRunnable(Scheduler.MapSerializableRunnable runnable, java.util.Date when)` Schedule a Runnable that will be executed on a dedicated thread pool.
    `java.lang.String` | `schedulePersistedJob(Scheduler.JobDetails jobDetail, java.util.Date when)` Schedule a persisted job.
    `java.lang.String` | `scheduleVolatileJob(boolean transacted, Scheduler.JobDetails jobDetail)` Schedule a volatile job for right now
    `java.lang.String` | `scheduleVolatileJob(boolean transacted, Scheduler.JobDetails jobDetail, java.util.Date when)` Schedule a volatile (non-persisted) job.
    `void` | `setJobProcessor(Scheduler.JobProcessor processor)`
    `void` | `setPolledRunnableProcesser(Scheduler.JobProcessor polledRunnableProcessor)`
    `void` | `setRollbackOnly()`
    `void` | `shutdown()`
    `void` | `start()`
    `void` | `stop()`

- - ### Method Detail

    - #### setJobProcessor

          void setJobProcessor(Scheduler.JobProcessor processor)
                        throws ContextException

      Throws:
        `ContextException`

    - #### setPolledRunnableProcesser

          void setPolledRunnableProcesser(Scheduler.JobProcessor polledRunnableProcessor)

    - #### schedulePersistedJob

          java.lang.String schedulePersistedJob(Scheduler.JobDetails jobDetail,
                                                java.util.Date when)
                                         throws ContextException

      Schedule a persisted job. Persisted jobs MUST survive system failure. They also must not be scheduled unless the transaction associated with the calling thread commits.
      Parameters:
        `jobDetail` - information about the job
        `when` - when the job should run (`null` means now)
      Returns:
        unique job identifier
      Throws:
        `ContextException`

    - #### scheduleMapSerializableRunnable

          java.lang.String scheduleMapSerializableRunnable(Scheduler.MapSerializableRunnable runnable,
                                                           java.util.Date when)
                                                    throws ContextException

      Schedule a Runnable that will be executed on a dedicated thread pool.
      Parameters:
        `runnable` -
        `when` -
      Returns:
      Throws:
        `ContextException`

    - #### scheduleVolatileJob

          java.lang.String scheduleVolatileJob(boolean transacted,
                                               Scheduler.JobDetails jobDetail,
                                               java.util.Date when)
                                        throws ContextException

      Schedule a volatile (non-persisted) job. Volatile jobs should not be saved in the database and should not survive system crash. Volatile jobs scheduled from a transactional context should be scheduled regardless of whether the transaction commits.
      Parameters:
        `transacted` - should the job be executed in a transaction?
        `jobDetail` - information about the job
        `when` - does the job should be executed?
      Returns:
        unique (as far as the scheduler is concerned) job identifier
      Throws:
        `ContextException`

    - #### scheduleVolatileJob

          java.lang.String scheduleVolatileJob(boolean transacted,
                                               Scheduler.JobDetails jobDetail)
                                        throws ContextException

      Schedule a volatile job for right now
      Throws:
        `ContextException`
      See Also:
        `#scheduleVolatileJob(boolean, java.util.Map, java.util.Date)`

    - #### cancelJob

          void cancelJob(java.lang.String jobId)
                  throws ContextException

      Make a good effort to cancel the job. If its already running no big deal.
      Parameters:
        `jobId` - job identifier of the job
      Throws:
        `ContextException`

    - #### execTransaction

          <T> T execTransaction(java.util.concurrent.Callable<T> transaction)
                         throws java.lang.Exception,
                                ContextException

      Execute a `Callable` in a transactional context. If the callable throws an exception, then the transaction will be rolled back, otherwise the transaction will commit.
      Type Parameters:
        `T` - return type
      Parameters:
        `transaction` - transaction to execute
      Returns:
        result
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### execTransaction

          <T> T execTransaction(java.util.concurrent.Callable<T> transaction,
                                int timeout)
                         throws java.lang.Exception,
                                ContextException

      Execute a `Callable` in a transactional context. If the callable throws an exception, then the transaction will be rolled back, otherwise the transaction will commit. Also, modify the value of the timeout value that is associated with the transactions started by the current thread.
      Type Parameters:
        `T` - return type
      Parameters:
        `transaction` - transaction to execute
        `timeout,` - The value of the timeout in seconds. If the value is zero, the transaction service uses the default value.
      Returns:
        result
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### setRollbackOnly

          void setRollbackOnly()
                        throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### execIsolatedTransaction

          <T> java.util.concurrent.Future<T> execIsolatedTransaction(java.util.concurrent.Callable<T> transaction)
                                                              throws java.lang.Exception,
                                                                     ContextException

      Same as execTransaction but executes in a different thread to guarantee isolation from the main execution thread.
      Parameters:
        `transaction` -
      Returns:
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### isTransacted

          boolean isTransacted()

      Returns:
        true if the current thread is associated with a transaction.

    - #### registerSynchronizer

          void registerSynchronizer(Scheduler.Synchronizer synch)
                             throws ContextException

      Register a transaction synchronizer.
      Parameters:
        `synch` - synchronizer
      Throws:
        `ContextException`

    - #### start

          void start()

    - #### stop

          void stop()

    - #### shutdown

          void shutdown()

    - #### acquireTransactionLocks

          void acquireTransactionLocks()