[jbpm-commits] JBoss JBPM SVN: r3271 - in jbpm3/trunk: modules/distribution and 7 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Mon Dec 8 09:27:35 EST 2008


Author: thomas.diesler at jboss.com
Date: 2008-12-08 09:27:35 -0500 (Mon, 08 Dec 2008)
New Revision: 3271

Added:
   jbpm3/trunk/modules/integration/jboss42/src/main/etc/bpm-process-deployer.xml
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3.java
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3MBean.java
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessDeploymentHelper.java
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployer.java
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployerMBean.java
Removed:
   jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java
   jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java
   jbpm3/trunk/modules/integration/jboss42/src/main/resources/
Modified:
   jbpm3/trunk/modules/distribution/pom.xml
   jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml
   jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
   jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml
   jbpm3/trunk/modules/integration/jboss42/deploy.sh
   jbpm3/trunk/modules/integration/jboss42/pom.xml
   jbpm3/trunk/modules/integration/jboss42/scripts/assembly-config.xml
   jbpm3/trunk/profiles.xml.example
Log:
Add ProcessArchiveDeployerInterceptorEJB3

Modified: jbpm3/trunk/modules/distribution/pom.xml
===================================================================
--- jbpm3/trunk/modules/distribution/pom.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/distribution/pom.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -30,72 +30,73 @@
   <dependencies>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-db</artifactId>
+      <artifactId>bpm-spec-integration-jboss42</artifactId>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-enterprise-beans</artifactId>
+      <artifactId>bpm-spec-integration-jboss42</artifactId>
+      <classifier>config</classifier>
       <version>${version}</version>
-      <type>ejb</type>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-enterprise-beans</artifactId>
-      <classifier>config</classifier>
+      <artifactId>bpm-spec-integration-jbpm3</artifactId>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-enterprise-bundle</artifactId>
+      <artifactId>bpm-spec-integration-jbpm3</artifactId>
+      <classifier>config</classifier>
       <version>${version}</version>
-      <type>ear</type>
     </dependency>
+    
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-examples</artifactId>
-      <classifier>examples</classifier>
+      <artifactId>jbpm-db</artifactId>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-identity</artifactId>
+      <artifactId>jbpm-enterprise-beans</artifactId>
       <version>${version}</version>
+      <type>ejb</type>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-identity</artifactId>
+      <artifactId>jbpm-enterprise-beans</artifactId>
       <classifier>config</classifier>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-identity</artifactId>
-      <classifier>service</classifier>
+      <artifactId>jbpm-enterprise-bundle</artifactId>
       <version>${version}</version>
-      <type>zip</type>
+      <type>ear</type>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-integration-jboss42</artifactId>
+      <artifactId>jbpm-examples</artifactId>
+      <classifier>examples</classifier>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>bpm-spec-integration-jbpm3</artifactId>
+      <artifactId>jbpm-identity</artifactId>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>bpm-spec-integration-jbpm3</artifactId>
+      <artifactId>jbpm-identity</artifactId>
       <classifier>config</classifier>
       <version>${version}</version>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-integration-jboss42</artifactId>
-      <classifier>config</classifier>
+      <artifactId>jbpm-identity</artifactId>
+      <classifier>service</classifier>
       <version>${version}</version>
+      <type>zip</type>
     </dependency>
     <dependency>
       <groupId>org.jbpm.jbpm3</groupId>

Modified: jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml
===================================================================
--- jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/distribution/scripts/assembly-deploy-artifacts.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -55,7 +55,7 @@
       <useStrictFiltering>true</useStrictFiltering>
       <includes>
         <include>*:bpm-spec-integration-jbpm3:jar:config</include>
-        <include>*:jbpm-integration-jboss42:jar:config</include>
+        <include>*:bpm-spec-integration-jboss42:jar:config</include>
       </includes>
       <unpack>true</unpack>
     </dependencySet>

Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/install-definition.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -145,6 +145,8 @@
         <include name="activation.jar" />
         <include name="antlr.jar" />
         <include name="asm.jar" />
+        <include name="bpm-spec-integration-jbpm3" />
+        <include name="bpm-spec-integration-jboss42.jar" />
         <include name="bsh.jar" />
         <include name="cglib.jar" />
         <include name="commons-collections.jar" />
@@ -155,8 +157,6 @@
         <include name="jbpm-enterprise-bundle.ear" />
         <include name="jbpm-jpdl.jar" />
         <include name="jbpm-identity.jar" />
-        <include name="bpm-spec-integration-jbpm3" />
-        <include name="jbpm-integration-jboss42.jar" />
         <include name="junit.jar" />
         <include name="jsf-console.war" />
         <include name="slf4j-api.jar" />
@@ -175,11 +175,19 @@
 
     <!-- jBPM3 Server Components -->
     <pack name="jBPM3 Server Components" required="yes" preselected="yes">
+    
       <description>The jBPM3 Server Components</description>
 
+      <!-- server/lib -->
+      <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${installPath}/server/${jbossTargetServer}/lib" override="true">
+        <include name="bpm-spec-api.jar" />
+        <include name="bpm-spec-integration-jboss42.jar" />
+        <include name="slf4j-api.jar" />
+        <include name="slf4j-log4j12.jar" />
+      </fileset>
+      
       <!-- jbpm/jbpm-integration.beans -->
       <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-integration.beans" override="true">
-        <include name="bpm-spec-api.jar" />
         <include name="bpm-spec-dialect-api10.jar" />
         <include name="bpm-spec-integration-jbpm3.jar" />
       </fileset>
@@ -193,14 +201,11 @@
         <include name="hibernate.extra.hbm.xml" />
       </fileset>
       <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-integration-config" targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
-        <include name="par-deployer.xml" />
+        <include name="bpm-process-deployer.xml" />
       </fileset>
       <fileset dir="@{deploy.artifacts.dir}/lib" targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar" override="true">
         <include name="jbpm-jpdl.jar" />
         <include name="jbpm-identity.jar" />
-        <include name="jbpm-integration-jboss42.jar" />
-        <include name="slf4j-api.jar" />
-        <include name="slf4j-log4j12.jar" />
       </fileset>
       <file src="@{deploy.artifacts.dir}/lib/jbpm-identity-service.zip" targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm/jbpm-service.sar"
         unpack="true" override="true" />
@@ -216,6 +221,14 @@
       <!-- jbpm-destinations-service -->
       <file src="@{resources.dir}/destination/jbpm-destinations-service.xml" targetdir="${installPath}/server/${jbossTargetServer}/deploy/jbpm" />
       
+      <!-- 
+      ********************************
+      *                              *  
+      *   Database Configuration     *
+      *                              *
+      ********************************
+      -->
+      
       <!-- database configs to docs/examples/jbpm -->
       <fileset dir="@{deploy.artifacts.dir}/resources/jbpm-jpdl-config" targetdir="${installPath}/docs/examples/jbpm" override="true">
         <include name="hibernate.cfg.hsqldb.xml"/>

Modified: jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml
===================================================================
--- jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/distribution/src/main/resources/installer/user-input-spec.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -4,9 +4,10 @@
     <field type="radio" variable="jbossSelection">
       <description align="left" txt="Please choose your target server" />
       <spec>
-        <choice txt="JBoss-4.2.2" value="jboss422" set="true" />
-        <choice txt="JBoss-4.2.3" value="jboss423" />
-        <choice txt="JBoss-5.0.0" value="jboss500" />
+        <choice txt="JBoss-5.0.0" value="jboss500" set="true"/>
+        <choice txt="JBoss-4.2.3" value="jboss423"/>
+        <choice txt="JBoss-4.2.2" value="jboss422"/>
+        <choice txt="None" value="noserver"/>
       </spec>
     </field>
     <field type="text" variable="jbossTargetServer">

Modified: jbpm3/trunk/modules/integration/jboss42/deploy.sh
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/deploy.sh	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/deploy.sh	2008-12-08 14:27:35 UTC (rev 3271)
@@ -1,5 +1,7 @@
 #! /bin/bash
 
+mvn -o install
+
 rm $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar/jbpm-integration-jboss42*.jar
 cp target/jbpm-integration-jboss42-3.3.1-SNAPSHOT.jar $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar
-cp src/main/etc/par-deployer.xml $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar
+cp src/main/etc/bpm-process-deployer.xml $JBOSS422/server/default/deploy/jbpm/jbpm-service.sar

Modified: jbpm3/trunk/modules/integration/jboss42/pom.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/pom.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/pom.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -17,7 +17,7 @@
 
   <name>JBoss jBPM3 - Integration JBoss42</name>
   <groupId>org.jbpm.jbpm3</groupId>
-  <artifactId>jbpm-integration-jboss42</artifactId>
+  <artifactId>bpm-spec-integration-jboss42</artifactId>
   <packaging>jar</packaging>
 
   <!-- Parent -->
@@ -38,11 +38,6 @@
   <dependencies>
     <!-- BPM Dependencies -->
     <dependency>
-      <groupId>org.jbpm.jbpm3</groupId>
-      <artifactId>jbpm-jpdl</artifactId>
-      <version>${version}</version>
-    </dependency>
-    <dependency>
       <groupId>org.jboss.bpm</groupId>
       <artifactId>bpm-spec-api</artifactId>
     </dependency>
@@ -59,6 +54,16 @@
     </dependency>
     <dependency>
       <groupId>jboss</groupId>
+      <artifactId>jboss-ejb3</artifactId>
+      <version>${jboss.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
+      <artifactId>jboss-ejb3x</artifactId>
+      <version>${jboss.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>jboss</groupId>
       <artifactId>jboss-jmx</artifactId>
       <version>${jboss.version}</version>
     </dependency>

Modified: jbpm3/trunk/modules/integration/jboss42/scripts/assembly-config.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/scripts/assembly-config.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/scripts/assembly-config.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -11,7 +11,7 @@
       <outputDirectory>/</outputDirectory>
       <includes>
         <include>jboss-beans.xml</include>
-        <include>par-deployer.xml</include>
+        <include>bpm-process-deployer.xml</include>
       </includes>
     </fileSet>
   </fileSets>

Added: jbpm3/trunk/modules/integration/jboss42/src/main/etc/bpm-process-deployer.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/bpm-process-deployer.xml	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/bpm-process-deployer.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- 
+	The JBoss service configuration file for the PAR deployer service.
+	
+  	$Id$
+-->
+<server>
+
+  <!-- 
+  <mbean code="org.jbpm.integration.jboss42.ProcessArchiveDeployerInterceptorEJB3" name="jboss.bpm:service=ProcessArchiveDeployerInterceptorEJB3">
+    <depends-list optional-attribute-name="Interceptables">
+       <depends-list-element>jboss.ejb3:service=EJB3Deployer</depends-list-element>
+    </depends-list>
+  </mbean>
+  -->
+  
+  <mbean code="org.jbpm.integration.jboss42.ProcessXMLSubDeployer" name="jboss.bpm:service=ProcessXMLDeployer">
+  </mbean>
+  
+</server>
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/etc/bpm-process-deployer.xml
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Deleted: jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/etc/par-deployer.xml	2008-12-08 14:27:35 UTC (rev 3271)
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- 
-	The JBoss service configuration file for the PAR deployer service.
-	
-  	$Id$
--->
-<server>
-  <mbean code="org.jbpm.integration.jboss42.PARSubDeployer" name="jboss.deployer:service=PARDeployer">
-    <depends>jboss.ejb:service=EJBDeployer</depends>
-  </mbean>
-</server>
\ No newline at end of file

Deleted: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployer.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jboss42;
-
-//$Id$
-
-import java.net.URL;
-
-import org.jboss.bpm.api.config.Configuration;
-import org.jboss.bpm.api.deployment.Deployment;
-import org.jboss.bpm.api.service.DeploymentService;
-import org.jboss.bpm.api.service.ProcessEngine;
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.SubDeployerSupport;
-
-/**
- * A deployer service that manages jBPM Process Archive Deployments
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 03-May-2007
- */
-public class PARSubDeployer extends SubDeployerSupport implements PARSubDeployerMBean
-{
-  /** The suffixes we accept, along with their relative order */
-  private static final String[] DEFAULT_ENHANCED_SUFFIXES = new String[] { "900:-process.xml", "900:.par" };
-
-  private DeploymentService depService;
-
-  public PARSubDeployer()
-  {
-    setEnhancedSuffixes(DEFAULT_ENHANCED_SUFFIXES);
-  }
-
-  @Override
-  @SuppressWarnings("unchecked")
-  public void create(DeploymentInfo di) throws DeploymentException
-  {
-    super.create(di);
-
-    URL pdURL = getProcessDefinitionURL(di);
-    log.info("Deploy ProcessDefinition: " + pdURL);
-
-    try
-    {
-      DeploymentService depService = getDeploymentService();
-      Deployment dep = depService.createDeployment(pdURL);
-      depService.deploy(dep);
-
-      // Remember the procDefID
-      di.context.put(Deployment.class.getName(), dep);
-    }
-    catch (RuntimeException rte)
-    {
-      throw rte;
-    }
-    catch (Exception ex)
-    {
-      throw new DeploymentException("Cannot deploy: " + pdURL, ex);
-    }
-  }
-
-  @Override
-  public void destroy(DeploymentInfo di) throws DeploymentException
-  {
-    URL pdURL = getProcessDefinitionURL(di);
-    log.info("Undeploy ProcessDefinition: " + pdURL);
-
-    Deployment dep = (Deployment)di.context.get(Deployment.class.getName());
-    if (dep != null)
-    {
-      try
-      {
-        DeploymentService depService = getDeploymentService();
-        depService.undeploy(dep);
-      }
-      catch (RuntimeException rte)
-      {
-        throw rte;
-      }
-      catch (Exception ex)
-      {
-        throw new DeploymentException("Cannot deploy: " + pdURL, ex);
-      }
-    }
-    super.destroy(di);
-  }
-
-  private URL getProcessDefinitionURL(DeploymentInfo di)
-  {
-    URL pdURL = di.localUrl != null ? di.localUrl : di.url;
-    if (pdURL == null)
-      throw new IllegalStateException("Cannot obtain process definition URL");
-
-    return pdURL;
-  }
-
-  private DeploymentService getDeploymentService()
-  {
-    // This is done lazily because the deployers become available before MC beans 
-    if (depService == null)
-    {
-      ProcessEngine engine = Configuration.getProcessEngine();
-      depService = engine.getService(DeploymentService.class);
-    }
-    return depService;
-  }
-}
\ No newline at end of file

Deleted: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/PARSubDeployerMBean.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -1,36 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.jboss42;
-
-//$Id$
-
-import org.jboss.deployment.SubDeployerExtMBean;
-
-/**
- * A deployer service that manages jBPM Process Archive Deployments
- * 
- * @author Thomas.Diesler at jboss.org
- * @since 03-May-2007
- */
-public interface PARSubDeployerMBean extends SubDeployerExtMBean
-{
-}
\ No newline at end of file

Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployment.SubDeployerInterceptorSupport;
+import org.jboss.mx.server.Invocation;
+import org.jboss.mx.util.MBeanProxy;
+
+/**
+ * A deployer service that manages BPM Process Deployments
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-Dec-2008
+ */
+public class ProcessArchiveDeployerInterceptorEJB3 extends SubDeployerInterceptorSupport implements ProcessArchiveDeployerInterceptorEJB3MBean
+{
+  // The main deployer
+  private MainDeployerMBean mainDeployer;
+  
+  @Override
+  protected final Object create(Invocation invocation, DeploymentInfo di) throws Throwable
+  {
+    Object retn = invokeNext(invocation);
+
+    ProcessDeploymentHelper depHelper = new ProcessDeploymentHelper();
+    depHelper.create(di);
+    
+    return retn;
+  }
+
+  @Override
+  protected final Object destroy(Invocation invocation, DeploymentInfo di) throws Throwable
+  {
+    Object retn = invokeNext(invocation);
+
+    ProcessDeploymentHelper depHelper = new ProcessDeploymentHelper();
+    depHelper.destroy(di);
+    
+    return retn;
+  }
+
+  /**
+   * Create the deployer service
+   */
+  protected void createService() throws Exception
+  {
+    mainDeployer = (MainDeployerMBean)MBeanProxy.get(MainDeployerMBean.class, MainDeployerMBean.OBJECT_NAME, server);
+    super.attach();
+  }
+
+  /**
+   *  Destroy the deployer service
+   */
+  protected void destroyService()
+  {
+    super.detach();
+  }
+
+  /**
+   * Handle all process deployment exceptions. 
+   * You can either simply log the problem and keep the EJB/WAR module alive or undeploy properly.
+   */
+  protected void handleStartupException(DeploymentInfo di, Throwable th)
+  {
+    log.error("Cannot startup process for: " + di.shortName, th);
+    mainDeployer.undeploy(di);
+  }
+
+  /**
+   * Handle all process deployment exceptions. 
+   * You can either simply logs the problem and keep the EJB/WAR module alive or undeploy properly.
+   */
+  protected void handleShutdownException(String moduleName, Throwable th)
+  {
+    log.error("Cannot shutdown process for: " + moduleName, th);
+  }
+}
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3MBean.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3MBean.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3MBean.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jboss42;
+
+//$Id$
+
+import javax.management.ObjectName;
+
+import org.jboss.bpm.api.model.builder.ObjectNameFactory;
+import org.jboss.deployment.SubDeployerInterceptorMBean;
+
+/**
+ * A deployer service that manages BPM Process Deployments
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-Dec-2008
+ */
+public interface ProcessArchiveDeployerInterceptorEJB3MBean extends SubDeployerInterceptorMBean
+{
+  // default object name
+  public static final ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.bpm:service=BPMDeployerEJB3");
+}
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessArchiveDeployerInterceptorEJB3MBean.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessDeploymentHelper.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessDeploymentHelper.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessDeploymentHelper.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,117 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jboss42;
+
+//$Id$
+
+import java.net.URL;
+
+import org.jboss.bpm.api.config.Configuration;
+import org.jboss.bpm.api.deployment.Deployment;
+import org.jboss.bpm.api.service.DeploymentService;
+import org.jboss.bpm.api.service.ProcessEngine;
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.logging.Logger;
+
+/**
+ * A deployer helper that manages BPM Process Deployments
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-Dec-2008
+ */
+class ProcessDeploymentHelper 
+{
+  // provide logging
+  private static Logger log = Logger.getLogger(ProcessDeploymentHelper.class);
+  
+  private DeploymentService depService;
+
+  @SuppressWarnings("unchecked")
+  public void create(DeploymentInfo di) throws DeploymentException
+  {
+    URL pdURL = getProcessDefinitionURL(di);
+    log.info("Deploy ProcessDefinition: " + pdURL);
+
+    try
+    {
+      DeploymentService depService = getDeploymentService();
+      Deployment dep = depService.createDeployment(pdURL);
+      depService.deploy(dep);
+
+      // Remember the procDefID
+      di.context.put(Deployment.class.getName(), dep);
+    }
+    catch (RuntimeException rte)
+    {
+      throw rte;
+    }
+    catch (Exception ex)
+    {
+      throw new DeploymentException("Cannot deploy: " + pdURL, ex);
+    }
+  }
+
+  public void destroy(DeploymentInfo di) throws DeploymentException
+  {
+    URL pdURL = getProcessDefinitionURL(di);
+    log.info("Undeploy ProcessDefinition: " + pdURL);
+
+    Deployment dep = (Deployment)di.context.get(Deployment.class.getName());
+    if (dep != null)
+    {
+      try
+      {
+        DeploymentService depService = getDeploymentService();
+        depService.undeploy(dep);
+      }
+      catch (RuntimeException rte)
+      {
+        throw rte;
+      }
+      catch (Exception ex)
+      {
+        throw new DeploymentException("Cannot deploy: " + pdURL, ex);
+      }
+    }
+  }
+
+  private URL getProcessDefinitionURL(DeploymentInfo di)
+  {
+    URL pdURL = di.localUrl != null ? di.localUrl : di.url;
+    if (pdURL == null)
+      throw new IllegalStateException("Cannot obtain process definition URL");
+
+    return pdURL;
+  }
+
+  private DeploymentService getDeploymentService()
+  {
+    // This is done lazily because the deployers become available before MC beans 
+    if (depService == null)
+    {
+      ProcessEngine engine = Configuration.getProcessEngine();
+      depService = engine.getService(DeploymentService.class);
+    }
+    return depService;
+  }
+}
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessDeploymentHelper.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployer.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployer.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployer.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.SubDeployerSupport;
+
+/**
+ * A deployer service that manages BPM Process Deployments
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 08-Dec-2008
+ */
+public class ProcessXMLSubDeployer extends SubDeployerSupport implements ProcessXMLSubDeployerMBean
+{
+  /* The suffixes we accept, along with their relative order */
+  private static final String[] DEFAULT_ENHANCED_SUFFIXES = new String[] { "900:-process.xml" };
+
+  private ProcessDeploymentHelper depHelper;
+
+  public ProcessXMLSubDeployer()
+  {
+    depHelper = new ProcessDeploymentHelper();
+    setEnhancedSuffixes(DEFAULT_ENHANCED_SUFFIXES);
+  }
+
+  @Override
+  public void create(DeploymentInfo di) throws DeploymentException
+  {
+    super.create(di);
+    depHelper.create(di);
+  }
+
+  @Override
+  public void destroy(DeploymentInfo di) throws DeploymentException
+  {
+    depHelper.destroy(di);
+    super.destroy(di);
+  }
+}
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployer.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Added: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployerMBean.java
===================================================================
--- jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployerMBean.java	                        (rev 0)
+++ jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployerMBean.java	2008-12-08 14:27:35 UTC (rev 3271)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.jboss42;
+
+//$Id$
+
+import org.jboss.deployment.SubDeployerExtMBean;
+
+/**
+ * A deployer service that manages jBPM Process Archive Deployments
+ * 
+ * @author Thomas.Diesler at jboss.org
+ * @since 03-May-2007
+ */
+public interface ProcessXMLSubDeployerMBean extends SubDeployerExtMBean
+{
+}
\ No newline at end of file


Property changes on: jbpm3/trunk/modules/integration/jboss42/src/main/java/org/jbpm/integration/jboss42/ProcessXMLSubDeployerMBean.java
___________________________________________________________________
Name: svn:keywords
   + Id Revision
Name: svn:eol-style
   + LF

Modified: jbpm3/trunk/profiles.xml.example
===================================================================
--- jbpm3/trunk/profiles.xml.example	2008-12-08 13:14:54 UTC (rev 3270)
+++ jbpm3/trunk/profiles.xml.example	2008-12-08 14:27:35 UTC (rev 3271)
@@ -13,7 +13,7 @@
       <properties>
         <jboss422.home>/home/tdiesler/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA</jboss422.home>
         <jboss423.home>/home/tdiesler/svn/jbossas/tags/JBoss_4_2_3_GA/build/output/jboss-4.2.3.GA</jboss423.home>
-        <jboss500.home>/home/tdiesler/svn/jbossas/tags/JBoss_5_0_0_CR2/build/output/jboss-5.0.0.CR2</jboss500.home>
+        <jboss500.home>/home/tdiesler/svn/jbossas/tags/JBoss_5_0_0_GA/build/output/jboss-5.0.0.GA</jboss500.home>
 
         <!--   
         <jdbc.mysql.url>jdbc:mysql://localhost:3306/jbpmtest</jdbc.mysql.url>




More information about the jbpm-commits mailing list