org.kie.services.remote.rest.async
Class AsyncDeploymentJobExecutor
java.lang.Object
org.kie.services.remote.rest.async.AsyncDeploymentJobExecutor
@ApplicationScoped
public class AsyncDeploymentJobExecutor
- extends Object
A lot of the ideas in this class have been taken from the org.jboss.resteasy.coreAsynchronousDispatcher class.
Unfortunately, the Resteasy asynchronous job mechanism has a number of bugs (most importantly, RESTEASY-682) which make it
unusable for our purposes.
Because tomcat compatibility is also important, we also can't use the EJB asynchronous mechanisms.
That leaves us with the java.util.concurrent.* executor framework. However, because the KModuleDeploymentService gives
no guarantee with regards to concurrency (e.g. is not thread-safe), it's important to make sure that the same deployment unit is
not concurrently deployed (or undeployed).
In order to satisfy that last requirement (no concurrent un/deployment of the same deployment unit), we use a single threaded
exector, which queues up other jobs.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_JOB_QUEUE_SIZE_PROP
public static final String MAX_JOB_QUEUE_SIZE_PROP
- See Also:
- Constant Field Values
AsyncDeploymentJobExecutor
public AsyncDeploymentJobExecutor()
submitDeployJob
public JaxbDeploymentJobResult submitDeployJob(org.jbpm.kie.services.impl.KModuleDeploymentService deploymentService,
org.jbpm.kie.services.impl.KModuleDeploymentUnit depUnit)
submitUndeployJob
public JaxbDeploymentJobResult submitUndeployJob(org.jbpm.kie.services.impl.KModuleDeploymentService deploymentService,
org.jbpm.kie.services.impl.KModuleDeploymentUnit depUnit)
getStatus
public JaxbDeploymentUnit.JaxbDeploymentStatus getStatus(String deploymentUnitId)
Copyright © 2001-2013 JBoss by Red Hat. All Rights Reserved.