Class CommonJWorkManagerExecutorService
- java.lang.Object
-
- org.camunda.bpm.container.impl.threading.ra.commonj.CommonJWorkManagerExecutorService
-
- All Implemented Interfaces:
ExecutorService
public class CommonJWorkManagerExecutorService extends java.lang.Object implements ExecutorService
AbstractPlatformJobExecutor
implementation delegating to a CommonJWorkManager
.- Author:
- Christian Lipphardt
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
commonJWorkManagerName
protected JcaExecutorServiceConnector
ra
protected commonj.work.WorkManager
workManager
-
Constructor Summary
Constructors Constructor Description CommonJWorkManagerExecutorService(JcaExecutorServiceConnector ra, java.lang.String commonJWorkManagerName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
executeShortRunning(java.lang.Runnable runnable)
java.lang.Runnable
getExecuteJobsRunnable(java.util.List<java.lang.String> jobIds, ProcessEngineImpl processEngine)
Returns a runnable to be used for executing Jobs.commonj.work.WorkManager
getWorkManager()
protected commonj.work.WorkManager
lookupWorkMananger()
boolean
schedule(java.lang.Runnable runnable, boolean isLongRunning)
Passes aRunnable
to the runtime container for execution.protected boolean
scheduleLongRunning(java.lang.Runnable acquisitionRunnable)
-
-
-
Field Detail
-
workManager
protected commonj.work.WorkManager workManager
-
ra
protected JcaExecutorServiceConnector ra
-
commonJWorkManagerName
protected java.lang.String commonJWorkManagerName
-
-
Constructor Detail
-
CommonJWorkManagerExecutorService
public CommonJWorkManagerExecutorService(JcaExecutorServiceConnector ra, java.lang.String commonJWorkManagerName)
-
-
Method Detail
-
lookupWorkMananger
protected commonj.work.WorkManager lookupWorkMananger()
-
schedule
public boolean schedule(java.lang.Runnable runnable, boolean isLongRunning)
Description copied from interface:ExecutorService
Passes a
Runnable
to the runtime container for execution. Some runtime containers (like a Java EE container offer container provided infrastructure for executing background work (such as a JCA WorkManager). This method allows the process engine to take advantage of container infrastructure for doing background work.- Specified by:
schedule
in interfaceExecutorService
- Parameters:
runnable
- theRunnable
to be executed.isLongRunning
- indicates whether the runnable is a daemon.- Returns:
- true if the runnable could be successfully scheduled for execution. 'false' otherwise.
-
executeShortRunning
protected boolean executeShortRunning(java.lang.Runnable runnable)
-
scheduleLongRunning
protected boolean scheduleLongRunning(java.lang.Runnable acquisitionRunnable)
-
getExecuteJobsRunnable
public java.lang.Runnable getExecuteJobsRunnable(java.util.List<java.lang.String> jobIds, ProcessEngineImpl processEngine)
Description copied from interface:ExecutorService
Returns a runnable to be used for executing Jobs.
- Specified by:
getExecuteJobsRunnable
in interfaceExecutorService
- Returns:
-
getWorkManager
public commonj.work.WorkManager getWorkManager()
-
-