KIE Remote Services :: Services 6.1.0.Beta1

org.kie.services.remote.rest.async
Class AsyncDeploymentJobExecutor

java.lang.Object
  extended by 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.


Field Summary
static String MAX_JOB_QUEUE_SIZE_PROP
           
 
Constructor Summary
AsyncDeploymentJobExecutor()
           
 
Method Summary
 JaxbDeploymentUnit.JaxbDeploymentStatus getStatus(String deploymentUnitId)
           
 JaxbDeploymentJobResult submitDeployJob(org.jbpm.kie.services.impl.KModuleDeploymentService deploymentService, org.jbpm.kie.services.impl.KModuleDeploymentUnit depUnit)
           
 JaxbDeploymentJobResult submitUndeployJob(org.jbpm.kie.services.impl.KModuleDeploymentService deploymentService, org.jbpm.kie.services.impl.KModuleDeploymentUnit depUnit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_JOB_QUEUE_SIZE_PROP

public static final String MAX_JOB_QUEUE_SIZE_PROP
See Also:
Constant Field Values
Constructor Detail

AsyncDeploymentJobExecutor

public AsyncDeploymentJobExecutor()
Method Detail

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)

KIE Remote Services :: Services 6.1.0.Beta1

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.