Package org.jbpm.executor.impl
Class ExecutorImpl
- java.lang.Object
-
- org.jbpm.executor.impl.ExecutorImpl
-
- All Implemented Interfaces:
org.kie.api.executor.Executor,org.kie.internal.executor.api.Executor
public class ExecutorImpl extends Object implements org.kie.internal.executor.api.Executor
Default implementation of theExecutorthat is baced byScheduledExecutorServicefor 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
- 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 Description ExecutorImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RequestInfobuildRequestInfo(String commandId, Date date, org.kie.api.executor.CommandContext ctx)voidcancelRequest(Long requestId)voidclearExecution(Long requestId)voiddestroy()protected ClassLoadergetClassLoader(String deploymentId)javax.jms.ConnectionFactorygetConnectionFactory()StringgetConnectionFactoryName()protected StringgetDeploymentId(org.kie.api.executor.CommandContext ctx)org.kie.api.executor.ExecutorStoreServicegetExecutorStoreService()intgetInterval()AvailableJobsExecutorgetJobProcessor()javax.jms.QueuegetQueue()StringgetQueueName()intgetRetries()protected ScheduledExecutorServicegetScheduledExecutorService()intgetThreadPoolSize()TimeUnitgetTimeunit()org.drools.persistence.api.TransactionManagergetTransactionManager()voidinit()voidmarkAsPendingRetryRequest(Long requestId)Consumer<Object>scheduleExecution(RequestInfo requestInfo, Date date)voidscheduleExecutionViaSync(RequestInfo requestInfo, Date date)LongscheduleRequest(String commandId, Date date, org.kie.api.executor.CommandContext ctx)LongscheduleRequest(String commandId, org.kie.api.executor.CommandContext ctx)protected voidsendMessage(String messageBody, int priority)voidsetConnectionFactory(javax.jms.ConnectionFactory connectionFactory)voidsetConnectionFactoryName(String connectionFactoryName)voidsetEventSupport(ExecutorEventSupport eventSupport)voidsetExecutorStoreService(org.kie.api.executor.ExecutorStoreService executorStoreService)voidsetInterval(int interval)voidsetJobProcessor(AvailableJobsExecutor jobProcessor)voidsetQueue(javax.jms.Queue queue)voidsetQueueName(String queueName)voidsetRetries(int retries)voidsetThreadPoolSize(int threadPoolSize)voidsetTimeunit(TimeUnit timeunit)voidsetTransactionManager(org.drools.persistence.api.TransactionManager transactionManager)voidupdateRequestData(Long requestId, Map<String,Object> data)
-
-
-
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:
getIntervalin interfaceorg.kie.api.executor.Executor
-
setInterval
public void setInterval(int interval)
- Specified by:
setIntervalin interfaceorg.kie.api.executor.Executor
-
getRetries
public int getRetries()
- Specified by:
getRetriesin interfaceorg.kie.api.executor.Executor
-
setRetries
public void setRetries(int retries)
- Specified by:
setRetriesin interfaceorg.kie.api.executor.Executor
-
getThreadPoolSize
public int getThreadPoolSize()
- Specified by:
getThreadPoolSizein interfaceorg.kie.api.executor.Executor
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize)
- Specified by:
setThreadPoolSizein interfaceorg.kie.api.executor.Executor
-
getTimeunit
public TimeUnit getTimeunit()
- Specified by:
getTimeunitin interfaceorg.kie.api.executor.Executor
-
setTimeunit
public void setTimeunit(TimeUnit timeunit)
- Specified by:
setTimeunitin interfaceorg.kie.api.executor.Executor
-
init
public void init()
- Specified by:
initin interfaceorg.kie.api.executor.Executor
-
destroy
public void destroy()
- Specified by:
destroyin interfaceorg.kie.api.executor.Executor
-
scheduleRequest
public Long scheduleRequest(String commandId, org.kie.api.executor.CommandContext ctx)
- Specified by:
scheduleRequestin interfaceorg.kie.api.executor.Executor
-
buildRequestInfo
public RequestInfo buildRequestInfo(String commandId, Date date, org.kie.api.executor.CommandContext ctx)
-
scheduleRequest
public Long scheduleRequest(String commandId, Date date, org.kie.api.executor.CommandContext ctx)
- Specified by:
scheduleRequestin interfaceorg.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:
cancelRequestin interfaceorg.kie.api.executor.Executor
-
markAsPendingRetryRequest
public void markAsPendingRetryRequest(Long requestId)
-
updateRequestData
public void updateRequestData(Long requestId, Map<String,Object> data)
- Specified by:
updateRequestDatain interfaceorg.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)
-
-