org.jbpm.process.core.timer.impl

## Class ThreadPoolSchedulerService

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

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

      public class ThreadPoolSchedulerService
      extends Object
      implements GlobalSchedulerService

  ThreadPool based scheduler service backed by `ThreadPoolSchedulerService`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ThreadPoolSchedulerService.GlobalJDKJobHandle`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThreadPoolSchedulerService(int poolSize)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.drools.core.time.JobHandle` | `buildJobHandleForContext(NamedJobContext ctx)` Builds JobHandle based on NamedJobContext
    `void` | `initScheduler(org.drools.core.time.TimerService globalTimerService)` Provides handle to inject timerService that owns this scheduler service and initialize it
    `void` | `internalSchedule(org.drools.core.time.impl.TimerJobInstance timerJobInstance)`
    `boolean` | `isTransactional()` Indicates if given implementation of scheduler service supports transactional timer store.
    `boolean` | `isValid(GlobalTimerService.GlobalJobHandle jobHandle)` Verifies if given job is still valid or it was already executed/vetoed.
    `boolean` | `removeJob(org.drools.core.time.JobHandle jobHandle)`
    `boolean` | `retryEnabled()` Indicates if given implementation of scheduler service supports retries of failed timer jobs
    `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` | `setInterceptor(SchedulerServiceInterceptor interceptor)` Allows to set interceptor that will be used to schedule timer instances
    `void` | `shutdown()` Allows to shutdown the scheduler service

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

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

- - ### Constructor Detail

    - #### ThreadPoolSchedulerService

          public ThreadPoolSchedulerService(int poolSize)

  - ### Method Detail

    - #### initScheduler

          public void initScheduler(org.drools.core.time.TimerService globalTimerService)

      Description copied from interface: `GlobalSchedulerService`
      Provides handle to inject timerService that owns this scheduler service and initialize it
      Specified by:
        `initScheduler` in interface `GlobalSchedulerService`
      Parameters:
        `globalTimerService` - owner of this scheduler service

    - #### shutdown

          public void shutdown()

      Description copied from interface: `GlobalSchedulerService`
      Allows to shutdown the scheduler service
      Specified by:
        `shutdown` in interface `GlobalSchedulerService`

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

    - #### internalSchedule

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

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

    - #### buildJobHandleForContext

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

      Description copied from interface: `GlobalSchedulerService`
      Builds JobHandle based on NamedJobContext
      Specified by:
        `buildJobHandleForContext` in interface `GlobalSchedulerService`
      Returns:

    - #### isTransactional

          public boolean isTransactional()

      Description copied from interface: `GlobalSchedulerService`
      Indicates if given implementation of scheduler service supports transactional timer store.
      Specified by:
        `isTransactional` in interface `GlobalSchedulerService`
      Returns:

    - #### setInterceptor

          public void setInterceptor(SchedulerServiceInterceptor interceptor)

      Description copied from interface: `GlobalSchedulerService`
      Allows to set interceptor that will be used to schedule timer instances
      Specified by:
        `setInterceptor` in interface `GlobalSchedulerService`

    - #### retryEnabled

          public boolean retryEnabled()

      Description copied from interface: `GlobalSchedulerService`
      Indicates if given implementation of scheduler service supports retries of failed timer jobs
      Specified by:
        `retryEnabled` in interface `GlobalSchedulerService`
      Returns:

    - #### isValid

          public boolean isValid(GlobalTimerService.GlobalJobHandle jobHandle)

      Description copied from interface: `GlobalSchedulerService`
      Verifies if given job is still valid or it was already executed/vetoed. Especially important in multi node environments - cluster.
      Specified by:
        `isValid` in interface `GlobalSchedulerService`
      Returns:

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