[jbpm-commits] JBoss JBPM SVN: r4259 - in jbpm4/trunk/modules: integration/jboss5/src/main/java/org/jbpm/integration/jboss5 and 1 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Mar 17 05:55:15 EDT 2009
Author: heiko.braun at jboss.com
Date: 2009-03-17 05:55:15 -0400 (Tue, 17 Mar 2009)
New Revision: 4259
Added:
jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDependenciesDeployer.java
Modified:
jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-deployers-jboss-beans.xml
Log:
JBPM-2109: Server shutdown undeployment calls have unmet dependency
Modified: jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-03-17 08:18:36 UTC (rev 4258)
+++ jbpm4/trunk/modules/distro/src/main/resources/installer/install-definition.xml 2009-03-17 09:55:15 UTC (rev 4259)
@@ -267,7 +267,7 @@
<include name="jbpm-log.jar" />
</fileset>
<fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jboss5-config/META-INF"
- targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/jbpm.deployer"
+ targetdir="${jbossInstallPath}/server/${jbossTargetServer}/deployers/jbpm.deployer/META-INF"
override="true"
condition="isJBoss500">
<include name="jbpm-deployers-jboss-beans.xml"/>
Added: jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDependenciesDeployer.java
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDependenciesDeployer.java (rev 0)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/java/org/jbpm/integration/jboss5/JBPMDependenciesDeployer.java 2009-03-17 09:55:15 UTC (rev 4259)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jbpm.integration.jboss5;
+
+import org.jboss.dependency.plugins.AbstractDependencyItem;
+import org.jboss.dependency.spi.ControllerState;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.DeploymentStages;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput;
+import org.jboss.deployers.spi.deployer.helpers.DeploymentVisitor;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.plugins.dependency.DependenciesMetaData;
+import org.jbpm.integration.spi.JBPMDeploymentMetaData;
+
+/**
+ * Adds dependency info to process deployments.
+ * I.e. every process deployment demands the TransactionManager.
+ * The microcontainer dependency information proper undeployment ordering upon server shutdown.
+ *
+ * @see http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4218501
+ * @author Heiko.Braun <heiko.braun at jboss.com>
+ */
+public class JBPMDependenciesDeployer extends AbstractRealDeployerWithInput<JBPMDeploymentMetaData>
+{
+ private static final String USER_TX_SERVICE_NAME = "jboss:service=ClientUserTransaction";
+
+ public JBPMDependenciesDeployer()
+ {
+ setStage(DeploymentStages.PRE_REAL);
+ setOutput(DependenciesMetaData.class);
+
+ DeploymentVisitor<JBPMDeploymentMetaData> visitor = new DeploymentVisitor<JBPMDeploymentMetaData>()
+ {
+ public void deploy(DeploymentUnit unit, JBPMDeploymentMetaData deployment)
+ throws DeploymentException
+ {
+ log.debug("Encountered deployment " + unit.getTopLevel());
+
+ unit.addIDependOn(
+ new AbstractDependencyItem(unit.getTopLevel().getName(),
+ USER_TX_SERVICE_NAME,
+ new ControllerState("Real"),
+ ControllerState.INSTALLED)
+ );
+ }
+
+ public Class<JBPMDeploymentMetaData> getVisitorType()
+ {
+ return JBPMDeploymentMetaData.class;
+ }
+
+ public void undeploy(DeploymentUnit unit, JBPMDeploymentMetaData deployment)
+ {
+ }
+ };
+
+ setDeploymentVisitor(visitor);
+ }
+}
Modified: jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-deployers-jboss-beans.xml
===================================================================
--- jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-deployers-jboss-beans.xml 2009-03-17 08:18:36 UTC (rev 4258)
+++ jbpm4/trunk/modules/integration/jboss5/src/main/resources/META-INF/jbpm-deployers-jboss-beans.xml 2009-03-17 09:55:15 UTC (rev 4259)
@@ -13,6 +13,13 @@
</bean>
<!--
+ Dependency decorator. I.e. Deployment->TransactionManager
+ -->
+ <bean name="org.jbpm:service=DependencyDeployer"
+ class="org.jbpm.integration.jboss5.JBPMDependenciesDeployer"/>
+
+
+ <!--
The JBPM Meta Data Deployer
-->
<bean name="org.jbpm:service=MetaDataDeployer"
More information about the jbpm-commits
mailing list