Package org.jbpm.process.core.timer.impl

## Class GlobalTimerService

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

- All Implemented Interfaces:
    `org.drools.core.time.InternalSchedulerService`, `org.drools.core.time.SchedulerService`, `org.drools.core.time.TimerService`

      public class GlobalTimerService
      extends Object
      implements org.drools.core.time.TimerService, org.drools.core.time.InternalSchedulerService

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `GlobalTimerService.DisposableCommandService` |
    `static class` | `GlobalTimerService.GlobalJobHandle` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.drools.core.time.impl.TimerJobFactoryManager` | `jobFactoryManager` |
    `protected org.kie.api.runtime.manager.RuntimeManager` | `manager` |
    `protected GlobalSchedulerService` | `schedulerService` |
    `protected ConcurrentSkipListSet<GlobalTimerService.GlobalJobHandle>` | `startTimerJobs` |
    `protected ConcurrentHashMap<Long,​List<GlobalTimerService.GlobalJobHandle>>` | `timerJobsPerSession` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GlobalTimerService​(org.kie.api.runtime.manager.RuntimeManager manager, GlobalSchedulerService schedulerService)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addTimerServiceListener​(TimerServiceListener timerServiceListener)` |
    `org.drools.core.time.JobHandle` | `buildJobHandleForContext​(NamedJobContext ctx)` |
    `void` | `clearTimerJobInstances​(long id)` |
    `void` | `destroy()` |
    `long` | `getCurrentTime()` |
    `List<TimerServiceListener>` | `getListeners()` |
    `protected org.kie.api.runtime.ExecutableRunner` | `getRunner​(Long processInstanceId, TimerManager.ProcessJobContext ctx)` |
    `org.kie.api.runtime.ExecutableRunner` | `getRunner​(org.drools.core.time.JobContext jobContext)` |
    `org.kie.internal.runtime.manager.InternalRuntimeManager` | `getRuntimeManager()` |
    `org.drools.core.time.impl.TimerJobFactoryManager` | `getTimerJobFactoryManager()` |
    `Collection<org.drools.core.time.impl.TimerJobInstance>` | `getTimerJobInstances​(long id)` |
    `ConcurrentHashMap<Long,​List<GlobalTimerService.GlobalJobHandle>>` | `getTimerJobsPerSession()` |
    `String` | `getTimerServiceId()` |
    `long` | `getTimeToNextJob()` |
    `void` | `internalSchedule​(org.drools.core.time.impl.TimerJobInstance timerJobInstance)` |
    `boolean` | `isTransactional()` |
    `boolean` | `removeJob​(org.drools.core.time.JobHandle jobHandle)` |
    `void` | `removeJobByTimerId​(long processInstanceId, long timerId)` |
    `void` | `removeTimerServiceListener​(TimerServiceListener timerServiceListener)` |
    `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` | `setTimerServiceId​(String timerServiceId)` |
    `void` | `shutdown()` |

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

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

- - ### Field Detail

    - #### jobFactoryManager

          protected org.drools.core.time.impl.TimerJobFactoryManager jobFactoryManager

    - #### schedulerService

          protected final GlobalSchedulerService schedulerService

    - #### manager

          protected final org.kie.api.runtime.manager.RuntimeManager manager

    - #### timerJobsPerSession

          protected final ConcurrentHashMap<Long,​List<GlobalTimerService.GlobalJobHandle>> timerJobsPerSession

    - #### startTimerJobs

          protected final ConcurrentSkipListSet<GlobalTimerService.GlobalJobHandle> startTimerJobs

  - ### Constructor Detail

    - #### GlobalTimerService

          public GlobalTimerService​(org.kie.api.runtime.manager.RuntimeManager manager,
                                    GlobalSchedulerService schedulerService)

  - ### Method Detail

    - #### isTransactional

          public boolean isTransactional()

    - #### 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`

    - #### removeJobByTimerId

          public void removeJobByTimerId​(long processInstanceId,
                                         long timerId)

    - #### removeJob

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

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

    - #### getCurrentTime

          public long getCurrentTime()

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

    - #### reset

          public void reset()

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

    - #### shutdown

          public void shutdown()

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

    - #### destroy

          public void destroy()

    - #### 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`

    - #### clearTimerJobInstances

          public void clearTimerJobInstances​(long id)

    - #### internalSchedule

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

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

    - #### 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`

    - #### getRunner

          public org.kie.api.runtime.ExecutableRunner getRunner​(org.drools.core.time.JobContext jobContext)

    - #### getTimerServiceId

          public String getTimerServiceId()

    - #### setTimerServiceId

          public void setTimerServiceId​(String timerServiceId)

    - #### buildJobHandleForContext

          public org.drools.core.time.JobHandle buildJobHandleForContext​(NamedJobContext ctx)

    - #### getRuntimeManager

          public org.kie.internal.runtime.manager.InternalRuntimeManager getRuntimeManager()

    - #### getRunner

          protected org.kie.api.runtime.ExecutableRunner getRunner​(Long processInstanceId,
                                                                   TimerManager.ProcessJobContext ctx)

    - #### getTimerJobsPerSession

          public ConcurrentHashMap<Long,​List<GlobalTimerService.GlobalJobHandle>> getTimerJobsPerSession()

    - #### getListeners

          public List<TimerServiceListener> getListeners()

    - #### addTimerServiceListener

          public void addTimerServiceListener​(TimerServiceListener timerServiceListener)

    - #### removeTimerServiceListener

          public void removeTimerServiceListener​(TimerServiceListener timerServiceListener)