org.jbpm.process.core.timer.impl

## Class RegisteredTimerServiceDelegate

- java.lang.Object
- - org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate

- All Implemented Interfaces:
    org.drools.core.time.InternalSchedulerService, org.drools.core.time.SchedulerService, org.drools.core.time.TimerService, org.kie.api.time.SessionClock

      public class RegisteredTimerServiceDelegate
      extends Object
      implements org.drools.core.time.TimerService, org.drools.core.time.InternalSchedulerService, org.kie.api.time.SessionClock

  Simple delegate for timer service that fetches the real instance of timer service from TimerServiceRegistry under "default" key. That requires TimerService to be registered prior to using this delegate, which usually means before any session is created. This delegate should be configured in session configuration so when initializing it will use right TimerService implementation: `Properties conf = new Properties(); conf.setProperty("drools.timerService", "org.jbpm.process.core.timer.impl.RegisteredTimerServiceDelegate"); KieSessionConfiguration sessionConf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(conf);`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RegisteredTimerServiceDelegate()`
    `RegisteredTimerServiceDelegate(String timerServiceKey)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCurrentTime()`
    `org.drools.core.time.impl.TimerJobFactoryManager` | `getTimerJobFactoryManager()`
    `Collection<org.drools.core.time.impl.TimerJobInstance>` | `getTimerJobInstances(long id)`
    `org.drools.core.time.TimerService` | `getTimerService()`
    `long` | `getTimeToNextJob()`
    `void` | `internalSchedule(org.drools.core.time.impl.TimerJobInstance timerJobInstance)`
    `boolean` | `removeJob(org.drools.core.time.JobHandle jobHandle)`
    `void` | `reset()`
    `org.drools.core.time.JobHandle` | `scheduleJob(org.drools.core.time.Job job, org.drools.core.time.JobContext ctx, org.drools.core.time.Trigger trigger)`
    `void` | `setTimerJobFactoryManager(org.drools.core.time.impl.TimerJobFactoryManager timerJobFactoryManager)`
    `void` | `shutdown()`

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

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

- - ### Constructor Detail

    - #### RegisteredTimerServiceDelegate

          public RegisteredTimerServiceDelegate()

    - #### RegisteredTimerServiceDelegate

          public RegisteredTimerServiceDelegate(String timerServiceKey)

  - ### Method Detail

    - #### getTimerService

          public org.drools.core.time.TimerService getTimerService()

    - #### scheduleJob

          public org.drools.core.time.JobHandle scheduleJob(org.drools.core.time.Job job,
                                                            org.drools.core.time.JobContext ctx,
                                                            org.drools.core.time.Trigger trigger)

      Specified by:
        `scheduleJob` in interface `org.drools.core.time.SchedulerService`

    - #### removeJob

          public boolean removeJob(org.drools.core.time.JobHandle jobHandle)

      Specified by:
        `removeJob` in interface `org.drools.core.time.SchedulerService`

    - #### setTimerJobFactoryManager

          public void setTimerJobFactoryManager(org.drools.core.time.impl.TimerJobFactoryManager timerJobFactoryManager)

      Specified by:
        `setTimerJobFactoryManager` in interface `org.drools.core.time.TimerService`

    - #### getTimerJobFactoryManager

          public org.drools.core.time.impl.TimerJobFactoryManager getTimerJobFactoryManager()

      Specified by:
        `getTimerJobFactoryManager` in interface `org.drools.core.time.TimerService`

    - #### internalSchedule

          public void internalSchedule(org.drools.core.time.impl.TimerJobInstance timerJobInstance)

      Specified by:
        `internalSchedule` in interface `org.drools.core.time.InternalSchedulerService`

    - #### getCurrentTime

          public long getCurrentTime()

      Specified by:
        `getCurrentTime` in interface `org.drools.core.time.TimerService`
      Specified by:
        `getCurrentTime` in interface `org.kie.api.time.SessionClock`

    - #### shutdown

          public void shutdown()

      Specified by:
        `shutdown` in interface `org.drools.core.time.TimerService`

    - #### getTimeToNextJob

          public long getTimeToNextJob()

      Specified by:
        `getTimeToNextJob` in interface `org.drools.core.time.TimerService`

    - #### getTimerJobInstances

          public Collection<org.drools.core.time.impl.TimerJobInstance> getTimerJobInstances(long id)

      Specified by:
        `getTimerJobInstances` in interface `org.drools.core.time.TimerService`

    - #### reset

          public void reset()

      Specified by:
        `reset` in interface `org.drools.core.time.TimerService`

Copyright © 2001–2021 JBoss by Red Hat. All rights reserved.