servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r431566 - in /incubator/servicemix/trunk: pom.xml servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java
Date Tue, 15 Aug 2006 10:02:31 GMT
Author: aco
Date: Tue Aug 15 03:02:30 2006
New Revision: 431566

URL: http://svn.apache.org/viewvc?rev=431566&view=rev
Log:
SM-542: added undeploy method in BPEDeployer. change the bpe jar to use the latest build.

Modified:
    incubator/servicemix/trunk/pom.xml
    incubator/servicemix/trunk/servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java

Modified: incubator/servicemix/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/pom.xml?rev=431566&r1=431565&r2=431566&view=diff
==============================================================================
--- incubator/servicemix/trunk/pom.xml (original)
+++ incubator/servicemix/trunk/pom.xml Tue Aug 15 03:02:30 2006
@@ -1811,7 +1811,7 @@
             <dependency>
                 <groupId>org.apache.ode</groupId>
                 <artifactId>bpe</artifactId>
-                <version>1.0-20060807</version>
+                <version>1.0-20060815</version>
             </dependency>
             <dependency>
                 <groupId>org.slf4j</groupId>

Modified: incubator/servicemix/trunk/servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java?rev=431566&r1=431565&r2=431566&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java
(original)
+++ incubator/servicemix/trunk/servicemix-bpe/src/main/java/org/apache/servicemix/bpe/BPEDeployer.java
Tue Aug 15 03:02:30 2006
@@ -56,6 +56,7 @@
 import org.apache.ode.bpe.wsdl.extensions.BPEVariableMap;
 import org.apache.ode.bpe.wsdl.extensions.BPEVariableMapSerializer;
 import org.apache.ode.bpe.wsdl.extensions.ExtentionConstants;
+import org.apache.ode.bpe.deployment.bpel.BPELDefinitionKey;
 import org.apache.servicemix.bpe.util.FileSystemJarInputStream;
 import org.apache.servicemix.common.AbstractDeployer;
 import org.apache.servicemix.common.ServiceUnit;
@@ -65,8 +66,9 @@
 public class BPEDeployer extends AbstractDeployer {
 
     protected FilenameFilter filter;
+    protected Collection defKeys;
     
-	public BPEDeployer(BPEComponent component) {
+    public BPEDeployer(BPEComponent component) {
 		super(component);
         filter = new BpelFilter();
 	}
@@ -80,7 +82,7 @@
 		try {
 			EventDirector ed = ((BPEComponent) component).getEventDirector();
 			IDeployer deployer = ed.getDeployer(DeployTypeEnum.BPEL);
-			deployer.loadDefinition(new FileSystemJarInputStream(new File(serviceUnitRootPath)), false);
+			defKeys = deployer.loadDefinition(new FileSystemJarInputStream(new File(serviceUnitRootPath)),
false);
 			// Build the Service Unit
 			BPEServiceUnit su = new BPEServiceUnit();
 			su.setComponent(component);
@@ -116,7 +118,22 @@
 		}
 	}
 
-	protected void checkDefinition(Definition rootDef, boolean main) throws DeploymentException
{
+    public void undeploy(ServiceUnit su) throws DeploymentException {
+        try {
+            EventDirector ed = ((BPEComponent) component).getEventDirector();
+            IDeployer deployer = ed.getDeployer(DeployTypeEnum.BPEL);
+            for (Iterator i = defKeys.iterator(); i.hasNext(); ) {
+                deployer.removeDefinition(((BPELDefinitionKey)i.next()).getKey());
+            }
+            su.shutDown();
+        } catch (DeploymentException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new DeploymentException(e);
+        }
+    }
+
+    protected void checkDefinition(Definition rootDef, boolean main) throws DeploymentException
{
         // Check that messages have only one part named "payload"
         Collection msgs = rootDef.getMessages().values();
         for (Iterator iter = msgs.iterator(); iter.hasNext();) {



Mime
View raw message