Author: objectiser
Date: 2011-02-04 07:10:39 -0500 (Fri, 04 Feb 2011)
New Revision: 1299
Added:
trunk/runtime/deployer-as5/
trunk/runtime/deployer-as5/pom.xml
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/AS5BPELDeployer.java
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/BPELStructureDeployer.java
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/AS6BPELDeployer.java
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/BPELStructureDeployer.java
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployerFactory.java
Removed:
trunk/runtime/deployer-as5/pom.xml
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
trunk/runtime/deployer-as5/src/test/java/org/jboss/soa/bpel/deployer/
trunk/runtime/deployer-as5/src/test/java/org/jboss/soa/bpel/runtime/
trunk/runtime/deployer-as5/src/test/resources/testdata/test_module_1.esb/
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
trunk/runtime/deployer-as6/src/test/java/org/jboss/soa/bpel/deployer/
trunk/runtime/deployer-as6/src/test/java/org/jboss/soa/bpel/runtime/
trunk/runtime/deployer-as6/src/test/resources/testdata/test_module_1.esb/
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
trunk/runtime/deployer/src/test/java/org/jboss/soa/bpel/runtime/
trunk/runtime/deployer/src/test/resources/testdata/test_module_1.esb/
Modified:
trunk/runtime/deployer-as6/pom.xml
trunk/runtime/deployer/pom.xml
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
trunk/runtime/engine/pom.xml
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java
trunk/runtime/pom.xml
Log:
RIFTSAW-333 - deployer now installs but requires further testing.
Modified: trunk/runtime/deployer/pom.xml
===================================================================
--- trunk/runtime/deployer/pom.xml 2011-02-03 12:47:54 UTC (rev 1298)
+++ trunk/runtime/deployer/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -3,10 +3,10 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.soa.bpel.runtime</groupId>
- <artifactId>deployer-as5</artifactId>
+ <artifactId>deployer</artifactId>
<packaging>jar</packaging>
<version>2.3.0-SNAPSHOT</version>
- <name>RiftSaw::Runtime::Deployer-AS5</name>
+ <name>RiftSaw::Runtime::Deployer</name>
<parent>
<groupId>org.jboss.soa.bpel</groupId>
@@ -16,54 +16,6 @@
<dependencies>
<dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.14.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.1.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>2.0.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-spi</artifactId>
<version>2.1.0.GA</version>
@@ -82,7 +34,7 @@
</dependency>
</dependencies>
<build>
- <finalName>jboss-riftsaw-deployer-as5</finalName>
+ <finalName>jboss-riftsaw-deployer</finalName>
<!-- This section defines the default plugin settings inherited by child projects.
-->
<pluginManagement>
Modified:
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -17,224 +17,21 @@
*/
package org.jboss.soa.bpel.deployer;
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.NonSerializableFactory;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-
/**
- * This is the deployer for deploying BPEL (and associated artifacts) into
- * the runtime.
+ * This class represents the BPEL deployer, responsible for
+ * deploying BPEL processes into the server.
*
* @author gbrown
*
*/
-public class BPELDeployer extends AbstractDeployer {
-
- public static final String BPELDeployerService="bpel/Deployer";
-
- public void deploy(DeploymentUnit du) throws DeploymentException {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- VirtualFile root=((VFSDeploymentUnit)du).getRoot();
-
- logger.debug("Deployment descriptor file="+root);
-
- try {
- VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
-
- logger.debug("Deployment unit dir="+parent);
-
- VirtualFile tmp=VFSUtils.explode(parent);
-
- java.net.URL url=VFSUtils.getCompatibleURL(tmp);
-
- logger.debug("Deployment exploded to dir="+tmp+" URL="+url);
-
- long lastModTime=0;
-
- if (top instanceof VFSDeploymentUnit) {
- lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
- } else {
- logger.warn("Unable to determine last modified time for: "+top);
- }
-
- // TODO: Need to be a more unique name, as it is possible that more
- // than one deployment descriptor may exist in the same AS archive
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
-
- java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName());
//BPELDeploymentUnit.BPEL_DEPLOY_XML);
-
- if (ddfile.exists() == false) {
- logger.error("Failed to deploy '"+ddfile+
- "', unable to locate deployment descriptor file");
- } else {
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.put(unit.getName(), unit);
-
- if (m_listener != null) {
- m_listener.deploy(unit);
- }
- }
- }
-
- } catch (Exception e) {
- throw new DeploymentException("Failed to explode deployment unit
'"+root+"'", e);
- }
- }
- }
+public interface BPELDeployer {
- @Override
- public void undeploy(DeploymentUnit du) {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- try {
- BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
-
- // Undeploy if deployment unit no longer exists on the filesystem, OR
- // the last modified time of the cached deployment unit is older than
- // the last modified time of the current deployment unit, signifying
- // it has been updated and therefore must be undeployed first
- if (top instanceof VFSDeploymentUnit &&
- (((VFSDeploymentUnit)top).getRoot().exists() == false ||
- (prev != null && prev.getLastModified() <
- ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
-
- // TODO: Unique name - see deploy
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
-
- // NOTE: File required to provide path for use in ODE
- // process store impl. When this is replaced, this information
- // will not be required.
- java.io.File ddfile=new
java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
-
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.remove(unit.getName());
-
- if (m_listener != null) {
- m_listener.undeploy(unit);
- }
- }
- } else {
- logger.info("Not undeploying BPEL: "+top.getSimpleName()+"
relativePath="+
- du.getRelativePath());
- }
- } catch(Exception e) {
- logger.error("Failed to undeploy '"+du+"'", e);
- }
- }
- }
-
/**
* This method sets the deployment listener that will be
* informed when BPEL deployment units are detected.
*
* @param l The BPEL deployment listener
*/
- public void setDeploymentListener(BPELDeploymentListener l) {
-
- logger.debug("Set deployment listener: "+l);
-
- synchronized(m_deploymentUnits) {
- m_listener = l;
-
- // Notify listener of the currently deployed units
- java.util.Iterator<BPELDeploymentUnit>
iter=m_deploymentUnits.values().iterator();
- while (iter.hasNext()) {
- l.deploy(iter.next());
- }
- }
- }
+ public void setDeploymentListener(BPELDeploymentListener l);
- /**
- * This method returns the JNDI name for the BPEL deployer.
- *
- * @return The JNDI name
- */
- public String getJndiName() {
- return m_jndiName;
- }
-
- /**
- * This method sets the JNDI name for the BPEL deployer.
- *
- * @param jndiName The JNDI name
- * @throws NamingException Failed to update JNDI with the supplied
- * name binding
- */
- public void setJndiName(String jndiName)throws NamingException {
- String oldName = m_jndiName;
- m_jndiName = jndiName;
-
- if (oldName != null) {
- unbind(oldName);
- }
-
- try {
- rebind();
- } catch(Exception e) {
- NamingException ne = new NamingException("Failed to update
jndiName");
- ne.setRootCause(e);
- throw ne;
- }
- }
-
- private void rebind() throws NamingException {
- InitialContext rootCtx = new InitialContext();
- Name fullName = rootCtx.getNameParser("").parse(m_jndiName);
- log.debug("Binding BPEL deployer to name="+fullName);
- NonSerializableFactory.rebind(fullName, this, true);
- }
-
- private void unbind(String jndiName) {
- try {
- InitialContext rootCtx = new InitialContext();
- rootCtx.unbind(jndiName);
- NonSerializableFactory.unbind(jndiName);
- } catch(NamingException e) {
- log.error("Failed to unbind map", e);
- }
- }
-
- private final static Logger logger = Logger.getLogger(BPELDeployer.class);
-
- private String m_jndiName=null;
- private BPELDeploymentListener m_listener=null;
- private java.util.Map<String, BPELDeploymentUnit> m_deploymentUnits=
- new java.util.HashMap<String, BPELDeploymentUnit>();
}
Added:
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployerFactory.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployerFactory.java
(rev 0)
+++
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployerFactory.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.deployer;
+
+/**
+ * This class represents the BPEL deployer factory, responsible for
+ * managing a deployer singleton.
+ *
+ * @author gbrown
+ *
+ */
+public class BPELDeployerFactory {
+
+ private static BPELDeployer m_instance=null;
+
+ /**
+ * This method returns the BPEL deployer singleton.
+ *
+ * @return The deployer singleton
+ */
+ public static BPELDeployer getInstance() {
+ return(m_instance);
+ }
+
+ /**
+ * This method sets the singleton.
+ *
+ * @param deployer The deployer
+ */
+ public static void setInstance(BPELDeployer deployer) {
+ m_instance = deployer;
+ }
+
+}
Deleted:
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Implementation of the BPEL Structure Deployer, used to locate the
- * BPEL deployment descriptor and create a context for the BPEL
- * deployment unit.
- *
- * @author gbrown
- *
- */
-public class BPELStructureDeployer extends AbstractStructureDeployer {
-
- @Override
- protected AnnotationEnvironment createAnnotationEnvironment(VirtualFile arg0) {
- return null;
- }
-
- public boolean determineStructure(StructureContext sc)
- throws DeploymentException {
- boolean ret=false;
-
- try {
- // Must look for the deployment descriptor, as opposed to the container
- // that contains the descriptor, because in the case of a Jar with the descriptor
- // at the top level, the deployer will not get called with the Jar top level
- // node, as this is handled by a Jar deployer.
- if (sc.getName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- sc.getName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML)) {
- ret = true;
-
- // Create the context for the deployment associated with
- // the deployment descriptor's parent container
- createContext(sc);
- }
- } catch (Exception e) {
- throw new DeploymentException(e);
- }
-
- return(ret);
- }
-
-}
Copied: trunk/runtime/deployer-as5 (from rev 1272, trunk/runtime/deployer)
Deleted: trunk/runtime/deployer-as5/pom.xml
===================================================================
--- trunk/runtime/deployer/pom.xml 2011-01-25 14:01:32 UTC (rev 1272)
+++ trunk/runtime/deployer-as5/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -1,170 +0,0 @@
-<?xml version="1.0"?>
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.soa.bpel.runtime</groupId>
- <artifactId>deployer</artifactId>
- <packaging>jar</packaging>
- <version>2.3.0-SNAPSHOT</version>
- <name>RiftSaw::Runtime::Deployer</name>
-
- <parent>
- <groupId>org.jboss.soa.bpel</groupId>
- <artifactId>runtime</artifactId>
- <version>2.3.0-SNAPSHOT</version>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- <version>2.2.14.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-structure-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-core-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-client-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.deployers</groupId>
- <artifactId>jboss-deployers-vfs-spi</artifactId>
- <version>2.0.7.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-vfs</artifactId>
- <version>2.1.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss</groupId>
- <artifactId>jboss-mdr</artifactId>
- <version>2.0.2.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.jboss.logging</groupId>
- <artifactId>jboss-logging-spi</artifactId>
- <version>2.1.0.GA</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>apache-xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>2.9.0</version>
- </dependency>
- </dependencies>
- <build>
- <finalName>jboss-riftsaw-deployer</finalName>
-
- <!-- This section defines the default plugin settings inherited by child projects.
-->
- <pluginManagement>
- <plugins>
- <!-- Fixes how test resources of a project can be used in projects dependent on it
-->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>2.2</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <version>2.2</version>
- <configuration>
- <aggregate>true</aggregate>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>jboss-packaging-maven-plugin</artifactId>
- <version>2.0-beta-1</version>
- <extensions>true</extensions>
- <configuration>
- <excludes>
- <exclude>jboss:jboss-common</exclude>
- <exclude>jboss:jboss-system</exclude>
- <exclude>jboss:jboss-jmx</exclude>
- </excludes>
- </configuration>
- </plugin>
-
- <!-- Specify the compiler options and settings -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
-
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- <showDeprecation>false</showDeprecation>
- <showWarnings>false</showWarnings>
- </configuration>
- </plugin>
-
- <!-- Produce source jars during the 'verify' phase -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-source-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-sources</id>
- <phase>verify</phase>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <includes>
- <include>**/*TestCase.java</include>
- <include>**/*Test.java</include>
- </includes>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
- <reporting>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- </plugin>
- </plugins>
- </reporting>
-
-</project>
Copied: trunk/runtime/deployer-as5/pom.xml (from rev 1273,
trunk/runtime/deployer/pom.xml)
===================================================================
--- trunk/runtime/deployer-as5/pom.xml (rev 0)
+++ trunk/runtime/deployer-as5/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -0,0 +1,176 @@
+<?xml version="1.0"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.soa.bpel.runtime</groupId>
+ <artifactId>deployer-as5</artifactId>
+ <packaging>jar</packaging>
+ <version>2.3.0-SNAPSHOT</version>
+ <name>RiftSaw::Runtime::Deployer-AS5</name>
+
+ <parent>
+ <groupId>org.jboss.soa.bpel</groupId>
+ <artifactId>runtime</artifactId>
+ <version>2.3.0-SNAPSHOT</version>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.soa.bpel.runtime</groupId>
+ <artifactId>deployer</artifactId>
+ <version>${riftsaw.engine.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ <version>2.2.14.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-structure-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-core-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-client-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.deployers</groupId>
+ <artifactId>jboss-deployers-vfs-spi</artifactId>
+ <version>2.0.7.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-vfs</artifactId>
+ <version>2.1.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jboss-mdr</artifactId>
+ <version>2.0.2.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.logging</groupId>
+ <artifactId>jboss-logging-spi</artifactId>
+ <version>2.1.0.GA</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>apache-xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.9.0</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <finalName>jboss-riftsaw-deployer-as5</finalName>
+
+ <!-- This section defines the default plugin settings inherited by child projects.
-->
+ <pluginManagement>
+ <plugins>
+ <!-- Fixes how test resources of a project can be used in projects dependent on it
-->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <aggregate>true</aggregate>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-packaging-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ <extensions>true</extensions>
+ <configuration>
+ <excludes>
+ <exclude>jboss:jboss-common</exclude>
+ <exclude>jboss:jboss-system</exclude>
+ <exclude>jboss:jboss-jmx</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <!-- Specify the compiler options and settings -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.0.2</version>
+
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ <showDeprecation>false</showDeprecation>
+ <showWarnings>false</showWarnings>
+ </configuration>
+ </plugin>
+
+ <!-- Produce source jars during the 'verify' phase -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <includes>
+ <include>**/*TestCase.java</include>
+ <include>**/*Test.java</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </reporting>
+
+</project>
Deleted:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-01-25
14:01:32 UTC (rev 1272)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,240 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.NonSerializableFactory;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * This is the deployer for deploying BPEL (and associated artifacts) into
- * the runtime.
- *
- * @author gbrown
- *
- */
-public class BPELDeployer extends AbstractDeployer {
-
- public static final String BPELDeployerService="bpel/Deployer";
-
- public void deploy(DeploymentUnit du) throws DeploymentException {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- VirtualFile root=((VFSDeploymentUnit)du).getRoot();
-
- logger.debug("Deployment descriptor file="+root);
-
- try {
- VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
-
- logger.debug("Deployment unit dir="+parent);
-
- VirtualFile tmp=VFSUtils.explode(parent);
-
- java.net.URL url=VFSUtils.getCompatibleURL(tmp);
-
- logger.debug("Deployment exploded to dir="+tmp+" URL="+url);
-
- long lastModTime=0;
-
- if (top instanceof VFSDeploymentUnit) {
- lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
- } else {
- logger.warn("Unable to determine last modified time for: "+top);
- }
-
- // TODO: Need to be a more unique name, as it is possible that more
- // than one deployment descriptor may exist in the same AS archive
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
-
- java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName());
//BPELDeploymentUnit.BPEL_DEPLOY_XML);
-
- if (ddfile.exists() == false) {
- logger.error("Failed to deploy '"+ddfile+
- "', unable to locate deployment descriptor file");
- } else {
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.put(unit.getName(), unit);
-
- if (m_listener != null) {
- m_listener.deploy(unit);
- }
- }
- }
-
- } catch (Exception e) {
- throw new DeploymentException("Failed to explode deployment unit
'"+root+"'", e);
- }
- }
- }
-
- @Override
- public void undeploy(DeploymentUnit du) {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- try {
- BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
-
- // Undeploy if deployment unit no longer exists on the filesystem, OR
- // the last modified time of the cached deployment unit is older than
- // the last modified time of the current deployment unit, signifying
- // it has been updated and therefore must be undeployed first
- if (top instanceof VFSDeploymentUnit &&
- (((VFSDeploymentUnit)top).getRoot().exists() == false ||
- (prev != null && prev.getLastModified() <
- ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
-
- // TODO: Unique name - see deploy
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
-
- // NOTE: File required to provide path for use in ODE
- // process store impl. When this is replaced, this information
- // will not be required.
- java.io.File ddfile=new
java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
-
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.remove(unit.getName());
-
- if (m_listener != null) {
- m_listener.undeploy(unit);
- }
- }
- } else {
- logger.info("Not undeploying BPEL: "+top.getSimpleName()+"
relativePath="+
- du.getRelativePath());
- }
- } catch(Exception e) {
- logger.error("Failed to undeploy '"+du+"'", e);
- }
- }
- }
-
- /**
- * This method sets the deployment listener that will be
- * informed when BPEL deployment units are detected.
- *
- * @param l The BPEL deployment listener
- */
- public void setDeploymentListener(BPELDeploymentListener l) {
-
- logger.debug("Set deployment listener: "+l);
-
- synchronized(m_deploymentUnits) {
- m_listener = l;
-
- // Notify listener of the currently deployed units
- java.util.Iterator<BPELDeploymentUnit>
iter=m_deploymentUnits.values().iterator();
- while (iter.hasNext()) {
- l.deploy(iter.next());
- }
- }
- }
-
- /**
- * This method returns the JNDI name for the BPEL deployer.
- *
- * @return The JNDI name
- */
- public String getJndiName() {
- return m_jndiName;
- }
-
- /**
- * This method sets the JNDI name for the BPEL deployer.
- *
- * @param jndiName The JNDI name
- * @throws NamingException Failed to update JNDI with the supplied
- * name binding
- */
- public void setJndiName(String jndiName)throws NamingException {
- String oldName = m_jndiName;
- m_jndiName = jndiName;
-
- if (oldName != null) {
- unbind(oldName);
- }
-
- try {
- rebind();
- } catch(Exception e) {
- NamingException ne = new NamingException("Failed to update
jndiName");
- ne.setRootCause(e);
- throw ne;
- }
- }
-
- private void rebind() throws NamingException {
- InitialContext rootCtx = new InitialContext();
- Name fullName = rootCtx.getNameParser("").parse(m_jndiName);
- log.debug("Binding BPEL deployer to name="+fullName);
- NonSerializableFactory.rebind(fullName, this, true);
- }
-
- private void unbind(String jndiName) {
- try {
- InitialContext rootCtx = new InitialContext();
- rootCtx.unbind(jndiName);
- NonSerializableFactory.unbind(jndiName);
- } catch(NamingException e) {
- log.error("Failed to unbind map", e);
- }
- }
-
- private final static Logger logger = Logger.getLogger(BPELDeployer.class);
-
- private String m_jndiName=null;
- private BPELDeploymentListener m_listener=null;
- private java.util.Map<String, BPELDeploymentUnit> m_deploymentUnits=
- new java.util.HashMap<String, BPELDeploymentUnit>();
-}
Deleted:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java 2011-01-25
14:01:32 UTC (rev 1272)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-/**
- * This interface represents a component interested in deploying BPEL deployment units.
- *
- * @author gbrown
- *
- */
-public interface BPELDeploymentListener {
-
- /**
- * This method is invoked to deploy a BPEL deployment unit.
- *
- * @param bdu The BPEL deployment unit
- */
- public void deploy(BPELDeploymentUnit bdu);
-
- /**
- * This method is invoked to undeploy a BPEL deployment unit.
- *
- * @param bdu The BPEL deployment unit
- */
- public void undeploy(BPELDeploymentUnit bdu);
-
-}
Deleted:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java 2011-01-25
14:01:32 UTC (rev 1272)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-/**
- * This class represents the BPEL deployment unit.
- *
- * @author gbrown
- *
- */
-public class BPELDeploymentUnit {
-
- public static final String BPEL_DEPLOY_XML = "bpel-deploy.xml";
- public static final String DEPLOY_XML = "deploy.xml";
-
- /**
- * The constructor for the deployment unit.
- *
- * @param name The unique name for the deployment unit
- * @param lastModified When the deployment unit was last modified
- */
- public BPELDeploymentUnit(String name, long lastModified) {
- m_name = name;
- m_lastModified = lastModified;
-
- // Remove any .jar suffix
- if (m_name != null && m_name.endsWith(".jar")) {
- m_name = m_name.substring(0, m_name.length()-4);
- }
- }
-
- /**
- * This method returns the name of the deployment unit.
- *
- * @return The name
- */
- public String getName() {
- return(m_name);
- }
-
- /**
- * This method returns the last modified time associated with
- * the deployment unit.
- *
- * @return The last modified time
- */
- public long getLastModified() {
- return(m_lastModified);
- }
-
- /**
- * This method returns the deployment descriptor.
- *
- * @return The deployment descriptor
- */
- public java.io.File getDeploymentDescriptor() {
- return(m_deploymentDescriptor);
- }
-
- /**
- * This method sets the deployment descriptor for the BPEL module
- * being deployed.
- *
- * @param file The BPEL deployment descriptor
- */
- public void setDeploymentDescriptor(java.io.File file) {
- m_deploymentDescriptor = file;
- }
-
- public String toString() {
- return("BPELDeploymentUnit[name="+m_name+",lastModified="+m_lastModified+",descriptor="+
- m_deploymentDescriptor+"]");
- }
-
- private String m_name=null;
- private long m_lastModified=0;
- private java.io.File m_deploymentDescriptor=null;
-}
Deleted:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
===================================================================
---
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-01-25
14:01:32 UTC (rev 1272)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * Implementation of the BPEL Structure Deployer, used to locate the
- * BPEL deployment descriptor and create a context for the BPEL
- * deployment unit.
- *
- * @author gbrown
- *
- */
-public class BPELStructureDeployer extends AbstractStructureDeployer {
-
- @Override
- protected AnnotationEnvironment createAnnotationEnvironment(VirtualFile arg0) {
- return null;
- }
-
- public boolean determineStructure(StructureContext sc)
- throws DeploymentException {
- boolean ret=false;
-
- try {
- // Must look for the deployment descriptor, as opposed to the container
- // that contains the descriptor, because in the case of a Jar with the descriptor
- // at the top level, the deployer will not get called with the Jar top level
- // node, as this is handled by a Jar deployer.
- if (sc.getName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- sc.getName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML)) {
- ret = true;
-
- // Create the context for the deployment associated with
- // the deployment descriptor's parent container
- createContext(sc);
- }
- } catch (Exception e) {
- throw new DeploymentException(e);
- }
-
- return(ret);
- }
-
-}
Copied:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/AS5BPELDeployer.java
(from rev 1272,
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java)
===================================================================
---
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/AS5BPELDeployer.java
(rev 0)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/AS5BPELDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -0,0 +1,190 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.deployer.as5;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+import org.jboss.logging.Logger;
+import org.jboss.soa.bpel.deployer.BPELDeployer;
+import org.jboss.soa.bpel.deployer.BPELDeployerFactory;
+import org.jboss.soa.bpel.deployer.BPELDeploymentListener;
+import org.jboss.soa.bpel.deployer.BPELDeploymentUnit;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * This is the deployer for deploying BPEL (and associated artifacts) into
+ * the runtime.
+ *
+ * @author gbrown
+ *
+ */
+public class AS5BPELDeployer extends AbstractDeployer implements BPELDeployer {
+
+ private final static Logger logger = Logger.getLogger(AS5BPELDeployer.class);
+
+ private BPELDeploymentListener m_listener=null;
+ private java.util.Map<String, BPELDeploymentUnit> m_deploymentUnits=
+ new java.util.HashMap<String, BPELDeploymentUnit>();
+
+ public AS5BPELDeployer() {
+ BPELDeployerFactory.setInstance(this);
+ }
+
+ public void deploy(DeploymentUnit du) throws DeploymentException {
+
+ if (du instanceof VFSDeploymentUnit &&
+ (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
+ DeploymentUnit top=du;
+
+ if (top.isTopLevel() == false) {
+ top = du.getTopLevel();
+ }
+
+ logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
+ du.getRelativePath());
+
+ VirtualFile root=((VFSDeploymentUnit)du).getRoot();
+
+ logger.debug("Deployment descriptor file="+root);
+
+ try {
+ VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
+
+ logger.debug("Deployment unit dir="+parent);
+
+ VirtualFile tmp=VFSUtils.explode(parent);
+
+ java.net.URL url=VFSUtils.getCompatibleURL(tmp);
+
+ logger.debug("Deployment exploded to dir="+tmp+" URL="+url);
+
+ long lastModTime=0;
+
+ if (top instanceof VFSDeploymentUnit) {
+ lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
+ } else {
+ logger.warn("Unable to determine last modified time for: "+top);
+ }
+
+ // TODO: Need to be a more unique name, as it is possible that more
+ // than one deployment descriptor may exist in the same AS archive
+ BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
+
+ java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName());
//BPELDeploymentUnit.BPEL_DEPLOY_XML);
+
+ if (ddfile.exists() == false) {
+ logger.error("Failed to deploy '"+ddfile+
+ "', unable to locate deployment descriptor file");
+ } else {
+ unit.setDeploymentDescriptor(ddfile);
+
+ synchronized(m_deploymentUnits) {
+ m_deploymentUnits.put(unit.getName(), unit);
+
+ if (m_listener != null) {
+ m_listener.deploy(unit);
+ }
+ }
+ }
+
+ } catch (Exception e) {
+ throw new DeploymentException("Failed to explode deployment unit
'"+root+"'", e);
+ }
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit du) {
+
+ if (du instanceof VFSDeploymentUnit &&
+ (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
+ DeploymentUnit top=du;
+
+ if (top.isTopLevel() == false) {
+ top = du.getTopLevel();
+ }
+
+ logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
+ du.getRelativePath());
+
+ try {
+ BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
+
+ // Undeploy if deployment unit no longer exists on the filesystem, OR
+ // the last modified time of the cached deployment unit is older than
+ // the last modified time of the current deployment unit, signifying
+ // it has been updated and therefore must be undeployed first
+ if (top instanceof VFSDeploymentUnit &&
+ (((VFSDeploymentUnit)top).getRoot().exists() == false ||
+ (prev != null && prev.getLastModified() <
+ ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
+
+ // TODO: Unique name - see deploy
+ BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
+
+ // NOTE: File required to provide path for use in ODE
+ // process store impl. When this is replaced, this information
+ // will not be required.
+ java.io.File ddfile=new
java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
+
+ unit.setDeploymentDescriptor(ddfile);
+
+ synchronized(m_deploymentUnits) {
+ m_deploymentUnits.remove(unit.getName());
+
+ if (m_listener != null) {
+ m_listener.undeploy(unit);
+ }
+ }
+ } else {
+ logger.info("Not undeploying BPEL: "+top.getSimpleName()+"
relativePath="+
+ du.getRelativePath());
+ }
+ } catch(Exception e) {
+ logger.error("Failed to undeploy '"+du+"'", e);
+ }
+ }
+ }
+
+ /**
+ * This method sets the deployment listener that will be
+ * informed when BPEL deployment units are detected.
+ *
+ * @param l The BPEL deployment listener
+ */
+ public void setDeploymentListener(BPELDeploymentListener l) {
+
+ logger.debug("Set deployment listener: "+l);
+
+ synchronized(m_deploymentUnits) {
+ m_listener = l;
+
+ // Notify listener of the currently deployed units
+ java.util.Iterator<BPELDeploymentUnit>
iter=m_deploymentUnits.values().iterator();
+ while (iter.hasNext()) {
+ l.deploy(iter.next());
+ }
+ }
+ }
+}
Copied:
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/BPELStructureDeployer.java
(from rev 1272,
trunk/runtime/deployer/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java)
===================================================================
---
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/BPELStructureDeployer.java
(rev 0)
+++
trunk/runtime/deployer-as5/src/main/java/org/jboss/soa/bpel/deployer/as5/BPELStructureDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.deployer.as5;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.soa.bpel.deployer.BPELDeploymentUnit;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Implementation of the BPEL Structure Deployer, used to locate the
+ * BPEL deployment descriptor and create a context for the BPEL
+ * deployment unit.
+ *
+ * @author gbrown
+ *
+ */
+public class BPELStructureDeployer extends AbstractStructureDeployer {
+
+ @Override
+ protected AnnotationEnvironment createAnnotationEnvironment(VirtualFile arg0) {
+ return null;
+ }
+
+ public boolean determineStructure(StructureContext sc)
+ throws DeploymentException {
+ boolean ret=false;
+
+ try {
+ // Must look for the deployment descriptor, as opposed to the container
+ // that contains the descriptor, because in the case of a Jar with the descriptor
+ // at the top level, the deployer will not get called with the Jar top level
+ // node, as this is handled by a Jar deployer.
+ if (sc.getName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ sc.getName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML)) {
+ ret = true;
+
+ // Create the context for the deployment associated with
+ // the deployment descriptor's parent container
+ createContext(sc);
+ }
+ } catch (Exception e) {
+ throw new DeploymentException(e);
+ }
+
+ return(ret);
+ }
+
+}
Modified: trunk/runtime/deployer-as6/pom.xml
===================================================================
--- trunk/runtime/deployer-as6/pom.xml 2011-02-03 12:47:54 UTC (rev 1298)
+++ trunk/runtime/deployer-as6/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -16,6 +16,12 @@
<dependencies>
<dependency>
+ <groupId>org.jboss.soa.bpel.runtime</groupId>
+ <artifactId>deployer</artifactId>
+ <version>${riftsaw.engine.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
<version>2.2.14.GA</version>
Deleted:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,241 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-import javax.naming.InitialContext;
-import javax.naming.Name;
-import javax.naming.NamingException;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-import org.jboss.logging.Logger;
-import org.jboss.util.naming.NonSerializableFactory;
-import org.jboss.vfs.VFSUtils;
-import org.jboss.vfs.VirtualFile;
-
-/**
- * This is the deployer for deploying BPEL (and associated artifacts) into
- * the runtime.
- *
- * @author gbrown
- *
- */
-public class BPELDeployer extends AbstractDeployer {
-
- public static final String BPELDeployerService="bpel/Deployer";
-
- public void deploy(DeploymentUnit du) throws DeploymentException {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- VirtualFile root=((VFSDeploymentUnit)du).getRoot();
-
- logger.debug("Deployment descriptor file="+root);
-
- try {
- VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
-
- logger.debug("Deployment unit dir="+parent);
-
- //VirtualFile tmp=VFSUtils.explode(parent);
-
- //java.net.URL url=VFSUtils.getCompatibleURL(tmp);
- java.net.URL url=VFSUtils.getPhysicalURL(root);
-
- logger.debug("Deployment exploded to dir="+root+" URL="+url);
-
- long lastModTime=0;
-
- if (top instanceof VFSDeploymentUnit) {
- lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
- } else {
- logger.warn("Unable to determine last modified time for: "+top);
- }
-
- // TODO: Need to be a more unique name, as it is possible that more
- // than one deployment descriptor may exist in the same AS archive
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
-
- java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName());
//BPELDeploymentUnit.BPEL_DEPLOY_XML);
-
- if (ddfile.exists() == false) {
- logger.error("Failed to deploy '"+ddfile+
- "', unable to locate deployment descriptor file");
- } else {
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.put(unit.getName(), unit);
-
- if (m_listener != null) {
- m_listener.deploy(unit);
- }
- }
- }
-
- } catch (Exception e) {
- throw new DeploymentException("Failed to explode deployment unit
'"+root+"'", e);
- }
- }
- }
-
- @Override
- public void undeploy(DeploymentUnit du) {
-
- if (du instanceof VFSDeploymentUnit &&
- (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
- DeploymentUnit top=du;
-
- if (top.isTopLevel() == false) {
- top = du.getTopLevel();
- }
-
- logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
- du.getRelativePath());
-
- try {
- BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
-
- // Undeploy if deployment unit no longer exists on the filesystem, OR
- // the last modified time of the cached deployment unit is older than
- // the last modified time of the current deployment unit, signifying
- // it has been updated and therefore must be undeployed first
- if (top instanceof VFSDeploymentUnit &&
- (((VFSDeploymentUnit)top).getRoot().exists() == false ||
- (prev != null && prev.getLastModified() <
- ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
-
- // TODO: Unique name - see deploy
- BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
-
- // NOTE: File required to provide path for use in ODE
- // process store impl. When this is replaced, this information
- // will not be required.
- java.io.File ddfile=new
java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
-
- unit.setDeploymentDescriptor(ddfile);
-
- synchronized(m_deploymentUnits) {
- m_deploymentUnits.remove(unit.getName());
-
- if (m_listener != null) {
- m_listener.undeploy(unit);
- }
- }
- } else {
- logger.info("Not undeploying BPEL: "+top.getSimpleName()+"
relativePath="+
- du.getRelativePath());
- }
- } catch(Exception e) {
- logger.error("Failed to undeploy '"+du+"'", e);
- }
- }
- }
-
- /**
- * This method sets the deployment listener that will be
- * informed when BPEL deployment units are detected.
- *
- * @param l The BPEL deployment listener
- */
- public void setDeploymentListener(BPELDeploymentListener l) {
-
- logger.debug("Set deployment listener: "+l);
-
- synchronized(m_deploymentUnits) {
- m_listener = l;
-
- // Notify listener of the currently deployed units
- java.util.Iterator<BPELDeploymentUnit>
iter=m_deploymentUnits.values().iterator();
- while (iter.hasNext()) {
- l.deploy(iter.next());
- }
- }
- }
-
- /**
- * This method returns the JNDI name for the BPEL deployer.
- *
- * @return The JNDI name
- */
- public String getJndiName() {
- return m_jndiName;
- }
-
- /**
- * This method sets the JNDI name for the BPEL deployer.
- *
- * @param jndiName The JNDI name
- * @throws NamingException Failed to update JNDI with the supplied
- * name binding
- */
- public void setJndiName(String jndiName)throws NamingException {
- String oldName = m_jndiName;
- m_jndiName = jndiName;
-
- if (oldName != null) {
- unbind(oldName);
- }
-
- try {
- rebind();
- } catch(Exception e) {
- NamingException ne = new NamingException("Failed to update
jndiName");
- ne.setRootCause(e);
- throw ne;
- }
- }
-
- private void rebind() throws NamingException {
- InitialContext rootCtx = new InitialContext();
- Name fullName = rootCtx.getNameParser("").parse(m_jndiName);
- log.debug("Binding BPEL deployer to name="+fullName);
- NonSerializableFactory.bind(fullName.toString(), this);
- }
-
- private void unbind(String jndiName) {
- try {
- InitialContext rootCtx = new InitialContext();
- rootCtx.unbind(jndiName);
- NonSerializableFactory.unbind(jndiName);
- } catch(NamingException e) {
- log.error("Failed to unbind map", e);
- }
- }
-
- private final static Logger logger = Logger.getLogger(BPELDeployer.class);
-
- private String m_jndiName=null;
- private BPELDeploymentListener m_listener=null;
- private java.util.Map<String, BPELDeploymentUnit> m_deploymentUnits=
- new java.util.HashMap<String, BPELDeploymentUnit>();
-}
Deleted:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentListener.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,42 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-/**
- * This interface represents a component interested in deploying BPEL deployment units.
- *
- * @author gbrown
- *
- */
-public interface BPELDeploymentListener {
-
- /**
- * This method is invoked to deploy a BPEL deployment unit.
- *
- * @param bdu The BPEL deployment unit
- */
- public void deploy(BPELDeploymentUnit bdu);
-
- /**
- * This method is invoked to undeploy a BPEL deployment unit.
- *
- * @param bdu The BPEL deployment unit
- */
- public void undeploy(BPELDeploymentUnit bdu);
-
-}
Deleted:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeploymentUnit.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-/**
- * This class represents the BPEL deployment unit.
- *
- * @author gbrown
- *
- */
-public class BPELDeploymentUnit {
-
- public static final String BPEL_DEPLOY_XML = "bpel-deploy.xml";
- public static final String DEPLOY_XML = "deploy.xml";
-
- /**
- * The constructor for the deployment unit.
- *
- * @param name The unique name for the deployment unit
- * @param lastModified When the deployment unit was last modified
- */
- public BPELDeploymentUnit(String name, long lastModified) {
- m_name = name;
- m_lastModified = lastModified;
-
- // Remove any .jar suffix
- if (m_name != null && m_name.endsWith(".jar")) {
- m_name = m_name.substring(0, m_name.length()-4);
- }
- }
-
- /**
- * This method returns the name of the deployment unit.
- *
- * @return The name
- */
- public String getName() {
- return(m_name);
- }
-
- /**
- * This method returns the last modified time associated with
- * the deployment unit.
- *
- * @return The last modified time
- */
- public long getLastModified() {
- return(m_lastModified);
- }
-
- /**
- * This method returns the deployment descriptor.
- *
- * @return The deployment descriptor
- */
- public java.io.File getDeploymentDescriptor() {
- return(m_deploymentDescriptor);
- }
-
- /**
- * This method sets the deployment descriptor for the BPEL module
- * being deployed.
- *
- * @param file The BPEL deployment descriptor
- */
- public void setDeploymentDescriptor(java.io.File file) {
- m_deploymentDescriptor = file;
- }
-
- public String toString() {
- return("BPELDeploymentUnit[name="+m_name+",lastModified="+m_lastModified+",descriptor="+
- m_deploymentDescriptor+"]");
- }
-
- private String m_name=null;
- private long m_lastModified=0;
- private java.io.File m_deploymentDescriptor=null;
-}
Deleted:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- */
-package org.jboss.soa.bpel.deployer;
-
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.StructureContext;
-import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
-import org.jboss.scanning.annotations.spi.AnnotationRepository;
-
-/**
- * Implementation of the BPEL Structure Deployer, used to locate the
- * BPEL deployment descriptor and create a context for the BPEL
- * deployment unit.
- *
- * @author gbrown
- *
- */
-public class BPELStructureDeployer extends AbstractStructureDeployer {
-
- public boolean determineStructure(StructureContext sc)
- throws DeploymentException {
- boolean ret=false;
-
- try {
- // Must look for the deployment descriptor, as opposed to the container
- // that contains the descriptor, because in the case of a Jar with the descriptor
- // at the top level, the deployer will not get called with the Jar top level
- // node, as this is handled by a Jar deployer.
- if (sc.getName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
- sc.getName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML)) {
- ret = true;
-
- // Create the context for the deployment associated with
- // the deployment descriptor's parent container
- createContext(sc);
- }
- } catch (Exception e) {
- throw new DeploymentException(e);
- }
-
- return(ret);
- }
-
- @Override
- protected AnnotationRepository createAnnotationRepository(
- org.jboss.vfs.VirtualFile arg0) {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
Copied:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/AS6BPELDeployer.java
(from rev 1273,
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELDeployer.java)
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/AS6BPELDeployer.java
(rev 0)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/AS6BPELDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -0,0 +1,191 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.deployer.as6;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+import org.jboss.logging.Logger;
+import org.jboss.soa.bpel.deployer.BPELDeployer;
+import org.jboss.soa.bpel.deployer.BPELDeployerFactory;
+import org.jboss.soa.bpel.deployer.BPELDeploymentListener;
+import org.jboss.soa.bpel.deployer.BPELDeploymentUnit;
+import org.jboss.vfs.VFSUtils;
+import org.jboss.vfs.VirtualFile;
+
+/**
+ * This is the deployer for deploying BPEL (and associated artifacts) into
+ * the runtime.
+ *
+ * @author gbrown
+ *
+ */
+public class AS6BPELDeployer extends AbstractDeployer implements BPELDeployer {
+
+ private final static Logger logger = Logger.getLogger(AS6BPELDeployer.class);
+
+ private BPELDeploymentListener m_listener=null;
+ private java.util.Map<String, BPELDeploymentUnit> m_deploymentUnits=
+ new java.util.HashMap<String, BPELDeploymentUnit>();
+
+ public AS6BPELDeployer() {
+ BPELDeployerFactory.setInstance(this);
+ }
+
+ public void deploy(DeploymentUnit du) throws DeploymentException {
+
+ if (du instanceof VFSDeploymentUnit &&
+ (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
+ DeploymentUnit top=du;
+
+ if (top.isTopLevel() == false) {
+ top = du.getTopLevel();
+ }
+
+ logger.info("Deploy: "+top.getSimpleName()+" relativePath="+
+ du.getRelativePath());
+
+ VirtualFile root=((VFSDeploymentUnit)du).getRoot();
+
+ logger.debug("Deployment descriptor file="+root);
+
+ try {
+ VirtualFile parent=((VFSDeploymentUnit)du).getRoot().getParent();
+
+ logger.debug("Deployment unit dir="+parent);
+
+ //VirtualFile tmp=VFSUtils.explode(parent);
+
+ //java.net.URL url=VFSUtils.getCompatibleURL(tmp);
+ java.net.URL url=VFSUtils.getPhysicalURL(root);
+
+ logger.debug("Deployment exploded to dir="+root+" URL="+url);
+
+ long lastModTime=0;
+
+ if (top instanceof VFSDeploymentUnit) {
+ lastModTime = ((VFSDeploymentUnit)top).getRoot().getLastModified();
+ } else {
+ logger.warn("Unable to determine last modified time for: "+top);
+ }
+
+ // TODO: Need to be a more unique name, as it is possible that more
+ // than one deployment descriptor may exist in the same AS archive
+ BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), lastModTime);
+
+ java.io.File ddfile=new java.io.File(url.getFile(), du.getSimpleName());
//BPELDeploymentUnit.BPEL_DEPLOY_XML);
+
+ if (ddfile.exists() == false) {
+ logger.error("Failed to deploy '"+ddfile+
+ "', unable to locate deployment descriptor file");
+ } else {
+ unit.setDeploymentDescriptor(ddfile);
+
+ synchronized(m_deploymentUnits) {
+ m_deploymentUnits.put(unit.getName(), unit);
+
+ if (m_listener != null) {
+ m_listener.deploy(unit);
+ }
+ }
+ }
+
+ } catch (Exception e) {
+ throw new DeploymentException("Failed to explode deployment unit
'"+root+"'", e);
+ }
+ }
+ }
+
+ @Override
+ public void undeploy(DeploymentUnit du) {
+
+ if (du instanceof VFSDeploymentUnit &&
+ (du.getSimpleName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ du.getSimpleName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML))) {
+ DeploymentUnit top=du;
+
+ if (top.isTopLevel() == false) {
+ top = du.getTopLevel();
+ }
+
+ logger.info("Undeploy: "+top.getSimpleName()+" relativePath="+
+ du.getRelativePath());
+
+ try {
+ BPELDeploymentUnit prev=m_deploymentUnits.get(top.getSimpleName());
+
+ // Undeploy if deployment unit no longer exists on the filesystem, OR
+ // the last modified time of the cached deployment unit is older than
+ // the last modified time of the current deployment unit, signifying
+ // it has been updated and therefore must be undeployed first
+ if (top instanceof VFSDeploymentUnit &&
+ (((VFSDeploymentUnit)top).getRoot().exists() == false ||
+ (prev != null && prev.getLastModified() <
+ ((VFSDeploymentUnit)top).getRoot().getLastModified()))) {
+
+ // TODO: Unique name - see deploy
+ BPELDeploymentUnit unit=new BPELDeploymentUnit(top.getSimpleName(), 0);
+
+ // NOTE: File required to provide path for use in ODE
+ // process store impl. When this is replaced, this information
+ // will not be required.
+ java.io.File ddfile=new
java.io.File(((VFSDeploymentUnit)du).getRoot().toURL().getFile());
+
+ unit.setDeploymentDescriptor(ddfile);
+
+ synchronized(m_deploymentUnits) {
+ m_deploymentUnits.remove(unit.getName());
+
+ if (m_listener != null) {
+ m_listener.undeploy(unit);
+ }
+ }
+ } else {
+ logger.info("Not undeploying BPEL: "+top.getSimpleName()+"
relativePath="+
+ du.getRelativePath());
+ }
+ } catch(Exception e) {
+ logger.error("Failed to undeploy '"+du+"'", e);
+ }
+ }
+ }
+
+ /**
+ * This method sets the deployment listener that will be
+ * informed when BPEL deployment units are detected.
+ *
+ * @param l The BPEL deployment listener
+ */
+ public void setDeploymentListener(BPELDeploymentListener l) {
+
+ logger.debug("Set deployment listener: "+l);
+
+ synchronized(m_deploymentUnits) {
+ m_listener = l;
+
+ // Notify listener of the currently deployed units
+ java.util.Iterator<BPELDeploymentUnit>
iter=m_deploymentUnits.values().iterator();
+ while (iter.hasNext()) {
+ l.deploy(iter.next());
+ }
+ }
+ }
+}
Copied:
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/BPELStructureDeployer.java
(from rev 1273,
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/BPELStructureDeployer.java)
===================================================================
---
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/BPELStructureDeployer.java
(rev 0)
+++
trunk/runtime/deployer-as6/src/main/java/org/jboss/soa/bpel/deployer/as6/BPELStructureDeployer.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ */
+package org.jboss.soa.bpel.deployer.as6;
+
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.scanning.annotations.spi.AnnotationRepository;
+import org.jboss.soa.bpel.deployer.BPELDeploymentUnit;
+
+/**
+ * Implementation of the BPEL Structure Deployer, used to locate the
+ * BPEL deployment descriptor and create a context for the BPEL
+ * deployment unit.
+ *
+ * @author gbrown
+ *
+ */
+public class BPELStructureDeployer extends AbstractStructureDeployer {
+
+ public boolean determineStructure(StructureContext sc)
+ throws DeploymentException {
+ boolean ret=false;
+
+ try {
+ // Must look for the deployment descriptor, as opposed to the container
+ // that contains the descriptor, because in the case of a Jar with the descriptor
+ // at the top level, the deployer will not get called with the Jar top level
+ // node, as this is handled by a Jar deployer.
+ if (sc.getName().equals(BPELDeploymentUnit.DEPLOY_XML) ||
+ sc.getName().equals(BPELDeploymentUnit.BPEL_DEPLOY_XML)) {
+ ret = true;
+
+ // Create the context for the deployment associated with
+ // the deployment descriptor's parent container
+ createContext(sc);
+ }
+ } catch (Exception e) {
+ throw new DeploymentException(e);
+ }
+
+ return(ret);
+ }
+
+ @Override
+ protected AnnotationRepository createAnnotationRepository(
+ org.jboss.vfs.VirtualFile arg0) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Modified: trunk/runtime/engine/pom.xml
===================================================================
--- trunk/runtime/engine/pom.xml 2011-02-03 12:47:54 UTC (rev 1298)
+++ trunk/runtime/engine/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -79,16 +79,10 @@
</dependency>
<dependency>
<groupId>org.jboss.soa.bpel.runtime</groupId>
- <artifactId>deployer-as5</artifactId>
- <version>${pom.version}</version>
+ <artifactId>deployer</artifactId>
+ <version>${riftsaw.engine.version}</version>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.jboss.soa.bpel.runtime</groupId>
- <artifactId>deployer-as6</artifactId>
- <version>${pom.version}</version>
- <scope>provided</scope>
- </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Modified:
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java
===================================================================
---
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java 2011-02-03
12:47:54 UTC (rev 1298)
+++
trunk/runtime/engine/src/main/java/org/apache/ode/store/RiftSawProcessStore.java 2011-02-04
12:10:39 UTC (rev 1299)
@@ -37,6 +37,7 @@
import org.apache.ode.dao.store.ConfStoreDAOConnectionFactory;
import org.apache.ode.dao.store.DeploymentUnitDAO;
import org.jboss.soa.bpel.deployer.BPELDeployer;
+import org.jboss.soa.bpel.deployer.BPELDeployerFactory;
import org.jboss.soa.bpel.deployer.BPELDeploymentUnit;
public class RiftSawProcessStore extends ProcessStoreImpl
@@ -53,18 +54,10 @@
public void loadAll() {
// Register listener with BPEL deployer
- try {
- InitialContext context=new InitialContext();
-
- BPELDeployer deployer=(BPELDeployer)context.lookup(BPELDeployer.BPELDeployerService);
-
- if (deployer != null) {
- deployer.setDeploymentListener(this);
- } else {
- __log.error("Deploy not found in JNDI with name
'"+BPELDeployer.BPELDeployerService+"'");
- }
- } catch(Exception e) {
- __log.error("Failed to obtain BPEL deployer", e);
+ if (BPELDeployerFactory.getInstance() == null) {
+ __log.error("BPEL deployer has not been registered - cannot listen for
deployments!");
+ } else {
+ BPELDeployerFactory.getInstance().setDeploymentListener(this);
}
}
Modified: trunk/runtime/pom.xml
===================================================================
--- trunk/runtime/pom.xml 2011-02-03 12:47:54 UTC (rev 1298)
+++ trunk/runtime/pom.xml 2011-02-04 12:10:39 UTC (rev 1299)
@@ -17,6 +17,7 @@
<modules>
<module>deployer</module>
+ <module>deployer-as5</module>
<module>deployer-as6</module>
<module>engine</module>
<module>uddi</module>