Package org.jbpm.persistence.timer

## Class GlobalJpaTimerJobInstance

- java.lang.Object
- - org.drools.core.time.impl.DefaultTimerJobInstance
  - - org.drools.persistence.jpa.JpaTimerJobInstance
    - - org.jbpm.persistence.timer.GlobalJpaTimerJobInstance

- All Implemented Interfaces:
    `Serializable`, `Comparable<org.drools.core.time.impl.DefaultTimerJobInstance>`, `Callable<Void>`, `org.drools.core.time.impl.TimerJobInstance`

      public class GlobalJpaTimerJobInstance
      extends org.drools.persistence.jpa.JpaTimerJobInstance

  Extension to the regular `JpaTimerJobInstance` that makes use of GlobalTimerService to allow auto reactivate session. Important to note is that when timer service created session this job instance will dispose that session to leave it in the same state it was before job was executed to avoid concurrent usage of the same session by different threads
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.drools.core.time.impl.DefaultTimerJobInstance

      `scheduler`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GlobalJpaTimerJobInstance​(org.drools.core.time.Job job, org.drools.core.time.JobContext ctx, org.drools.core.time.Trigger trigger, org.drools.core.time.JobHandle handle, org.drools.core.time.InternalSchedulerService scheduler)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `allowedToDispose​(org.kie.api.runtime.Environment environment)` |
    `Void` | `call()` |
    `protected void` | `closeTansactionIfNeeded​(org.drools.persistence.api.TransactionManager jtaTm, boolean commit)` |
    `String` | `getExternalTimerId()` |
    `Serializable` | `getTimerInfo()` |
    `protected boolean` | `hasEnvironmentEntry​(org.kie.api.runtime.Environment environment, String name, Object value)` |
    `void` | `setExternalTimerId​(String externalTimerId)` |
    `void` | `setTimerInfo​(Serializable timerInfo)` |
    `protected org.drools.persistence.api.TransactionManager` | `startTxIfNeeded​(org.kie.api.runtime.Environment environment)` |
    `String` | `toString()` |

    - ### Methods inherited from class org.drools.core.time.impl.DefaultTimerJobInstance

      `compareTo, getJob, getJobContext, getJobHandle, getTrigger`

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

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

- - ### Constructor Detail

    - #### GlobalJpaTimerJobInstance

          public GlobalJpaTimerJobInstance​(org.drools.core.time.Job job,
                                           org.drools.core.time.JobContext ctx,
                                           org.drools.core.time.Trigger trigger,
                                           org.drools.core.time.JobHandle handle,
                                           org.drools.core.time.InternalSchedulerService scheduler)

  - ### Method Detail

    - #### call

          public Void call()
                    throws Exception

      Specified by:
        `call` in interface `Callable<Void>`
      Overrides:
        `call` in class `org.drools.persistence.jpa.JpaTimerJobInstance`
      Throws:
        `Exception`

    - #### getTimerInfo

          public Serializable getTimerInfo()

    - #### setTimerInfo

          public void setTimerInfo​(Serializable timerInfo)

    - #### getExternalTimerId

          public String getExternalTimerId()

    - #### setExternalTimerId

          public void setExternalTimerId​(String externalTimerId)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### allowedToDispose

          protected boolean allowedToDispose​(org.kie.api.runtime.Environment environment)

    - #### hasEnvironmentEntry

          protected boolean hasEnvironmentEntry​(org.kie.api.runtime.Environment environment,
                                                String name,
                                                Object value)

    - #### startTxIfNeeded

          protected org.drools.persistence.api.TransactionManager startTxIfNeeded​(org.kie.api.runtime.Environment environment)

    - #### closeTansactionIfNeeded

          protected void closeTansactionIfNeeded​(org.drools.persistence.api.TransactionManager jtaTm,
                                                 boolean commit)