[Design the new POJO MicroContainer] - Re: Locks on MainDeployerImpl
by alesj
I guess if I just write lock the deploy and undeploy lists processing, you should be fine.
| Index: deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
| ===================================================================
| --- deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java (revision 84459)
| +++ deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java (working copy)
| @@ -322,33 +322,41 @@
| @@ -623,13 +631,13 @@
| if (deployers == null)
| throw new IllegalStateException("No deployers");
|
| + List<DeploymentContext> undeployContexts = null;
| lockWrite();
| try
| {
| if (shutdown.get())
| throw new IllegalStateException("The main deployer is shutdown");
|
| - List<DeploymentContext> undeployContexts = null;
| if (undeploy.isEmpty() == false)
| {
| // Undeploy in reverse order (subdeployments first)
| @@ -640,21 +648,33 @@
| Collections.sort(undeployContexts, reverted);
| undeploy.clear();
| }
| - if (undeployContexts != null)
| - {
| - deployers.process(null, undeployContexts);
| - }
| + }
| + finally
| + {
| + unlockWrite();
| + }
|
| - try
| - {
| - processToDeploy();
| - }
| - catch (DeploymentException e)
| - {
| - throw new RuntimeException("Error while processing new deployments", e);
| - }
| + if (undeployContexts != null)
| + {
| + deployers.process(null, undeployContexts);
| + }
|
| - List<DeploymentContext> deployContexts = null;
| + try
| + {
| + processToDeploy();
| + }
| + catch (DeploymentException e)
| + {
| + throw new RuntimeException("Error while processing new deployments", e);
| + }
| +
| + List<DeploymentContext> deployContexts = null;
| + lockWrite();
| + try
| + {
| + if (shutdown.get())
| + throw new IllegalStateException("The main deployer is shutdown");
| +
| if (deploy.isEmpty() == false)
| {
| deployContexts = new ArrayList<DeploymentContext>(deploy);
| @@ -662,15 +682,16 @@
| Collections.sort(deployContexts, comparator);
| deploy.clear();
| }
| - if (deployContexts != null)
| - {
| - deployers.process(deployContexts, null);
| - }
| }
| finally
| {
| unlockWrite();
| }
| +
| + if (deployContexts != null)
| + {
| + deployers.process(deployContexts, null);
| + }
| }
|
| public DeploymentStage getDeploymentStage(String deploymentName) throws DeploymentException
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211731#4211731
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211731
17 years, 1 month
[Design of JBoss jBPM] - Ending executions API
by heiko.braun@jboss.com
I was just looking at the ActivityExecution interface, it says:
| /** view upon an {@link Execution path of execution} exposed to
| * {@link ActivityBehaviour} implementations.
| *
| * @author Tom Baeyens
| */
| public interface ActivityExecution extends OpenExecution {
|
However it exposes e method to end the execution which states:
| /** ends this execution and all of its child executions.
| *
| * <p>The execution will be removed from it's parent. Potentially this can cause
| * a parent execution to start executing in case this is the last concurrent
| * execution for which the parent is waiting.</p>
| *
| * <p>This method should not be called in {@link ActivityBehaviour}s. It can be called from
| * outside the process execution and in {@link ExternalActivityBehaviour}s. </p> */
| void end();
|
This method should not be called in {@link ActivityBehaviour}s.
Why is in the interface then?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4211726#4211726
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4211726
17 years, 1 month