org.jbpm.executor.impl

## Class ExecutorImpl

- java.lang.Object
- - org.jbpm.executor.impl.ExecutorImpl

- All Implemented Interfaces:
    org.kie.api.executor.Executor

      public class ExecutorImpl
      extends Object
      implements org.kie.internal.executor.api.Executor

  Default implementation of the `Executor` that is baced by `ScheduledExecutorService` for background task execution. It can be configured for following:
  - thread pool size - default 1 - use system property org.kie.executor.pool.size
  - retry count - default 3 retries - use system property org.kie.executor.retry.count
  - execution interval - default 3 seconds - use system property org.kie.executor.interval
  Additionally executor can be disable to not start at all when system property org.kie.executor.disabled is set to true Executor can be used with JMS as the medium to notify about jobs to be executed instead of relying strictly on poll mechanism that is available by default. JMS support is configurable and is enabled by default although it requires JMS resources (connection factory and destination) to properly operate. If any of these will not be found it will deactivate JMS support. Configuration parameters for JMS support:
  - org.kie.executor.jms - allows to enable JMS support globally - default set to true
  - org.kie.executor.jms.cf - JNDI name of connection factory to be used for sending messages
  - org.kie.executor.jms.queue - JNDI name for destination (usually a queue) to be used to send messages to

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExecutorImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancelRequest(Long requestId)`
    `void` | `clearExecution(Long requestId)`
    `void` | `destroy()`
    `protected ClassLoader` | `getClassLoader(String deploymentId)`
    `javax.jms.ConnectionFactory` | `getConnectionFactory()`
    `String` | `getConnectionFactoryName()`
    `protected String` | `getDeploymentId(org.kie.api.executor.CommandContext ctx)`
    `org.kie.api.executor.ExecutorStoreService` | `getExecutorStoreService()`
    `int` | `getInterval()`
    `AvailableJobsExecutor` | `getJobProcessor()`
    `javax.jms.Queue` | `getQueue()`
    `String` | `getQueueName()`
    `int` | `getRetries()`
    `protected ScheduledExecutorService` | `getScheduledExecutorService()`
    `int` | `getThreadPoolSize()`
    `TimeUnit` | `getTimeunit()`
    `org.drools.persistence.api.TransactionManager` | `getTransactionManager()`
    `void` | `init()`
    `Consumer<Object>` | `scheduleExecution(RequestInfo requestInfo, Date date)`
    `void` | `scheduleExecutionViaSync(RequestInfo requestInfo, Date date)`
    `Long` | `scheduleRequest(String commandId, org.kie.api.executor.CommandContext ctx)`
    `Long` | `scheduleRequest(String commandId, Date date, org.kie.api.executor.CommandContext ctx)`
    `protected void` | `sendMessage(String messageBody, int priority)`
    `void` | `setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)`
    `void` | `setConnectionFactoryName(String connectionFactoryName)`
    `void` | `setEventSupport(ExecutorEventSupport eventSupport)`
    `void` | `setExecutorStoreService(org.kie.api.executor.ExecutorStoreService executorStoreService)`
    `void` | `setInterval(int interval)`
    `void` | `setJobProcessor(AvailableJobsExecutor jobProcessor)`
    `void` | `setQueue(javax.jms.Queue queue)`
    `void` | `setQueueName(String queueName)`
    `void` | `setRetries(int retries)`
    `void` | `setThreadPoolSize(int threadPoolSize)`
    `void` | `setTimeunit(TimeUnit timeunit)`
    `void` | `setTransactionManager(org.drools.persistence.api.TransactionManager transactionManager)`
    `void` | `updateRequestData(Long requestId, Map<String,Object> data)`

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

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

- - ### Constructor Detail

    - #### ExecutorImpl

          public ExecutorImpl()

  - ### Method Detail

    - #### setEventSupport

          public void setEventSupport(ExecutorEventSupport eventSupport)

    - #### setExecutorStoreService

          public void setExecutorStoreService(org.kie.api.executor.ExecutorStoreService executorStoreService)

    - #### getExecutorStoreService

          public org.kie.api.executor.ExecutorStoreService getExecutorStoreService()

    - #### getConnectionFactoryName

          public String getConnectionFactoryName()

    - #### setConnectionFactoryName

          public void setConnectionFactoryName(String connectionFactoryName)

    - #### getQueueName

          public String getQueueName()

    - #### setQueueName

          public void setQueueName(String queueName)

    - #### getConnectionFactory

          public javax.jms.ConnectionFactory getConnectionFactory()

    - #### setConnectionFactory

          public void setConnectionFactory(javax.jms.ConnectionFactory connectionFactory)

    - #### getQueue

          public javax.jms.Queue getQueue()

    - #### setQueue

          public void setQueue(javax.jms.Queue queue)

    - #### getJobProcessor

          public AvailableJobsExecutor getJobProcessor()

    - #### setJobProcessor

          public void setJobProcessor(AvailableJobsExecutor jobProcessor)

    - #### getTransactionManager

          public org.drools.persistence.api.TransactionManager getTransactionManager()

    - #### setTransactionManager

          public void setTransactionManager(org.drools.persistence.api.TransactionManager transactionManager)

    - #### getInterval

          public int getInterval()

      Specified by:
        `getInterval` in interface `org.kie.api.executor.Executor`

    - #### setInterval

          public void setInterval(int interval)

      Specified by:
        `setInterval` in interface `org.kie.api.executor.Executor`

    - #### getRetries

          public int getRetries()

      Specified by:
        `getRetries` in interface `org.kie.api.executor.Executor`

    - #### setRetries

          public void setRetries(int retries)

      Specified by:
        `setRetries` in interface `org.kie.api.executor.Executor`

    - #### getThreadPoolSize

          public int getThreadPoolSize()

      Specified by:
        `getThreadPoolSize` in interface `org.kie.api.executor.Executor`

    - #### setThreadPoolSize

          public void setThreadPoolSize(int threadPoolSize)

      Specified by:
        `setThreadPoolSize` in interface `org.kie.api.executor.Executor`

    - #### getTimeunit

          public TimeUnit getTimeunit()

      Specified by:
        `getTimeunit` in interface `org.kie.api.executor.Executor`

    - #### setTimeunit

          public void setTimeunit(TimeUnit timeunit)

      Specified by:
        `setTimeunit` in interface `org.kie.api.executor.Executor`

    - #### init

          public void init()

      Specified by:
        `init` in interface `org.kie.api.executor.Executor`

    - #### destroy

          public void destroy()

      Specified by:
        `destroy` in interface `org.kie.api.executor.Executor`

    - #### scheduleRequest

          public Long scheduleRequest(String commandId,
                                      org.kie.api.executor.CommandContext ctx)

      Specified by:
        `scheduleRequest` in interface `org.kie.api.executor.Executor`

    - #### scheduleRequest

          public Long scheduleRequest(String commandId,
                                      Date date,
                                      org.kie.api.executor.CommandContext ctx)

      Specified by:
        `scheduleRequest` in interface `org.kie.api.executor.Executor`

    - #### scheduleExecution

          public Consumer<Object> scheduleExecution(RequestInfo requestInfo,
                                                    Date date)

    - #### scheduleExecutionViaSync

          public void scheduleExecutionViaSync(RequestInfo requestInfo,
                                               Date date)

    - #### clearExecution

          public void clearExecution(Long requestId)

    - #### cancelRequest

          public void cancelRequest(Long requestId)

      Specified by:
        `cancelRequest` in interface `org.kie.api.executor.Executor`

    - #### updateRequestData

          public void updateRequestData(Long requestId,
                                        Map<String,Object> data)

      Specified by:
        `updateRequestData` in interface `org.kie.api.executor.Executor`

    - #### sendMessage

          protected void sendMessage(String messageBody,
                                     int priority)

    - #### getClassLoader

          protected ClassLoader getClassLoader(String deploymentId)

    - #### getScheduledExecutorService

          protected ScheduledExecutorService getScheduledExecutorService()

    - #### getDeploymentId

          protected String getDeploymentId(org.kie.api.executor.CommandContext ctx)

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