org.apache.ode.bpel.engine.replayer

## Class ReplayerScheduler

- java.lang.Object
- - org.apache.ode.bpel.engine.replayer.ReplayerScheduler

- All Implemented Interfaces:
    Scheduler

      public class ReplayerScheduler
      extends java.lang.Object
      implements Scheduler

  Manages events invocation in sorted order during replaying.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.ode.bpel.iapi.Scheduler

      `Scheduler.JobDetails, Scheduler.JobInfo, Scheduler.JobProcessor, Scheduler.JobProcessorException, Scheduler.JobType, Scheduler.MapSerializableRunnable, Scheduler.Synchronizer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.ThreadLocal<org.apache.ode.bpel.engine.replayer.ReplayerScheduler.TaskElement>` | `currentTaskElement`
    `Replayer` | `replayer`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReplayerScheduler()`

  - ### Method Summary

    All Methods Instance Methods Concrete 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 when1)` Schedule a persisted job.
    `void` | `scheduleReplayerJob(java.util.concurrent.Callable action, java.util.Date when, ReplayerBpelRuntimeContextImpl runtimeContext)`
    `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` | `startReplaying(Replayer replayer)`
    `void` | `stop()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### replayer

          public Replayer replayer

    - #### currentTaskElement

          public static java.lang.ThreadLocal<org.apache.ode.bpel.engine.replayer.ReplayerScheduler.TaskElement> currentTaskElement

  - ### Constructor Detail

    - #### ReplayerScheduler

          public ReplayerScheduler()

  - ### Method Detail

    - #### scheduleReplayerJob

          public void scheduleReplayerJob(java.util.concurrent.Callable action,
                                          java.util.Date when,
                                          ReplayerBpelRuntimeContextImpl runtimeContext)

    - #### cancelJob

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

      Description copied from interface: `Scheduler`
      Make a good effort to cancel the job. If its already running no big deal.
      Specified by:
        `cancelJob` in interface `Scheduler`
      Parameters:
        `jobId` - job identifier of the job
      Throws:
        `ContextException`

    - #### execTransaction

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

      Description copied from interface: `Scheduler`
      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.
      Specified by:
        `execTransaction` in interface `Scheduler`
      Type Parameters:
        `T` - return type
      Parameters:
        `transaction` - transaction to execute
      Returns:
        result
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### execTransaction

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

      Description copied from interface: `Scheduler`
      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.
      Specified by:
        `execTransaction` in interface `Scheduler`
      Type Parameters:
        `T` - return type
      Parameters:
        `transaction` - transaction to execute
      Returns:
        result
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### isTransacted

          public boolean isTransacted()

      Specified by:
        `isTransacted` in interface `Scheduler`
      Returns:
        true if the current thread is associated with a transaction.

    - #### registerSynchronizer

          public void registerSynchronizer(Scheduler.Synchronizer synch)
                                    throws ContextException

      Description copied from interface: `Scheduler`
      Register a transaction synchronizer.
      Specified by:
        `registerSynchronizer` in interface `Scheduler`
      Parameters:
        `synch` - synchronizer
      Throws:
        `ContextException`

    - #### setJobProcessor

          public void setJobProcessor(Scheduler.JobProcessor processor)
                               throws ContextException

      Specified by:
        `setJobProcessor` in interface `Scheduler`
      Throws:
        `ContextException`

    - #### setRollbackOnly

          public void setRollbackOnly()
                               throws java.lang.Exception

      Specified by:
        `setRollbackOnly` in interface `Scheduler`
      Throws:
        `java.lang.Exception`

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `Scheduler`

    - #### acquireTransactionLocks

          public void acquireTransactionLocks()

      Specified by:
        `acquireTransactionLocks` in interface `Scheduler`

    - #### startReplaying

          public void startReplaying(Replayer replayer)
                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### stop

          public void stop()

      Specified by:
        `stop` in interface `Scheduler`

    - #### start

          public void start()

      Specified by:
        `start` in interface `Scheduler`

    - #### execIsolatedTransaction

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

      Description copied from interface: `Scheduler`
      Same as execTransaction but executes in a different thread to guarantee isolation from the main execution thread.
      Specified by:
        `execIsolatedTransaction` in interface `Scheduler`
      Returns:
      Throws:
        `java.lang.Exception`
        `ContextException`

    - #### scheduleMapSerializableRunnable

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

      Description copied from interface: `Scheduler`
      Schedule a Runnable that will be executed on a dedicated thread pool.
      Specified by:
        `scheduleMapSerializableRunnable` in interface `Scheduler`
      Returns:
      Throws:
        `ContextException`

    - #### schedulePersistedJob

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

      Description copied from interface: `Scheduler`
      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.
      Specified by:
        `schedulePersistedJob` in interface `Scheduler`
      Parameters:
        `jobDetail` - information about the job
        `when1` - when the job should run (`null` means now)
      Returns:
        unique job identifier
      Throws:
        `ContextException`

    - #### setPolledRunnableProcesser

          public void setPolledRunnableProcesser(Scheduler.JobProcessor polledRunnableProcessor)

      Specified by:
        `setPolledRunnableProcesser` in interface `Scheduler`

    - #### scheduleVolatileJob

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

      Description copied from interface: `Scheduler`
      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.
      Specified by:
        `scheduleVolatileJob` in interface `Scheduler`
      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

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

      Description copied from interface: `Scheduler`
      Schedule a volatile job for right now
      Specified by:
        `scheduleVolatileJob` in interface `Scheduler`
      Throws:
        `ContextException`
      See Also:
        `#scheduleVolatileJob(boolean, java.util.Map, java.util.Date)`