Class JcaWorkManagerExecutorService
- java.lang.Object
-
- org.camunda.bpm.container.impl.threading.ra.JcaWorkManagerExecutorService
-
- All Implemented Interfaces:
javax.naming.Referenceable
,javax.resource.Referenceable
,ExecutorService
public class JcaWorkManagerExecutorService extends java.lang.Object implements javax.resource.Referenceable, ExecutorService
AbstractPlatformJobExecutor
implementation delegating to a JCAWorkManager
.- Author:
- Daniel Meyer
-
-
Field Summary
Fields Modifier and Type Field Description protected JcaExecutorServiceConnector
ra
protected javax.naming.Reference
reference
static int
START_WORK_TIMEOUT
protected javax.resource.spi.work.WorkManager
workManager
-
Constructor Summary
Constructors Constructor Description JcaWorkManagerExecutorService(JcaExecutorServiceConnector connector, javax.resource.spi.work.WorkManager workManager)
-
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.JcaExecutorServiceConnector
getPlatformJobExecutorConnector()
javax.naming.Reference
getReference()
javax.resource.spi.work.WorkManager
getWorkManager()
boolean
schedule(java.lang.Runnable runnable, boolean isLongRunning)
Passes aRunnable
to the runtime container for execution.protected boolean
scheduleLongRunning(java.lang.Runnable runnable)
void
setReference(javax.naming.Reference reference)
-
-
-
Field Detail
-
START_WORK_TIMEOUT
public static int START_WORK_TIMEOUT
-
ra
protected final JcaExecutorServiceConnector ra
-
workManager
protected javax.resource.spi.work.WorkManager workManager
-
reference
protected javax.naming.Reference reference
-
-
Constructor Detail
-
JcaWorkManagerExecutorService
public JcaWorkManagerExecutorService(JcaExecutorServiceConnector connector, javax.resource.spi.work.WorkManager workManager)
-
-
Method Detail
-
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.
-
scheduleLongRunning
protected boolean scheduleLongRunning(java.lang.Runnable runnable)
-
executeShortRunning
protected boolean executeShortRunning(java.lang.Runnable runnable)
-
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:
-
getReference
public javax.naming.Reference getReference() throws javax.naming.NamingException
- Specified by:
getReference
in interfacejavax.naming.Referenceable
- Throws:
javax.naming.NamingException
-
setReference
public void setReference(javax.naming.Reference reference)
- Specified by:
setReference
in interfacejavax.resource.Referenceable
-
getWorkManager
public javax.resource.spi.work.WorkManager getWorkManager()
-
getPlatformJobExecutorConnector
public JcaExecutorServiceConnector getPlatformJobExecutorConnector()
-
-