org.jbpm.process.core.timer

## Class TimerServiceRegistry

- java.lang.Object
- - org.jbpm.process.core.timer.TimerServiceRegistry

-     public class TimerServiceRegistry
      extends Object

  Simple TimerService registry used for single point registration of `TimerService` instances used by sessions. Registry is intended to be used at the application startup to register all required TimerServices so it can start operate as soon as it is active even if the session are not yet active.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `TIMER_SERVICE_SUFFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TimerServiceRegistry()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.drools.core.time.TimerService` | `get(String id)` Returns TimerService instance registered under given key
    `static TimerServiceRegistry` | `getInstance()`
    `void` | `registerTimerService(String id, org.drools.core.time.TimerService timerService)` Registers timerServie under given id.
    `org.drools.core.time.TimerService` | `remove(String id)` Removes TimerService from the registry.

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

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

- - ### Field Detail

    - #### TIMER_SERVICE_SUFFIX

          public static final String TIMER_SERVICE_SUFFIX

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TimerServiceRegistry

          public TimerServiceRegistry()

  - ### Method Detail

    - #### getInstance

          public static TimerServiceRegistry getInstance()

    - #### registerTimerService

          public void registerTimerService(String id,
                                           org.drools.core.time.TimerService timerService)

      Registers timerServie under given id. In case timer service is already registered with this id it will be overridden.
      Parameters:
        `id` - key used to get hold of the timer service instance
        `timerService` - fully initialized TimerService instance

    - #### get

          public org.drools.core.time.TimerService get(String id)

      Returns TimerService instance registered under given key
      Parameters:
        `id` - timer service identifier
      Returns:
        returns timer service instance or null of there was none registered with given id

    - #### remove

          public org.drools.core.time.TimerService remove(String id)

      Removes TimerService from the registry.
      Parameters:
        `id` - timer service identifier
      Returns:
        returns TimerService instance returned from the registry for cleanup tasks

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