servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r466064 - in /incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common: ServiceUnit.java wsdl1/AbstractWsdl1Deployer.java
Date Fri, 20 Oct 2006 11:17:48 GMT
Author: gnodet
Date: Fri Oct 20 04:17:45 2006
New Revision: 466064

URL: http://svn.apache.org/viewvc?view=rev&rev=466064
Log:
When adding an Endpoint to a ServiceUnit, activate it if the SU was already started

Modified:
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ServiceUnit.java
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/wsdl1/AbstractWsdl1Deployer.java

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ServiceUnit.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ServiceUnit.java?view=diff&rev=466064&r1=466063&r2=466064
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ServiceUnit.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/ServiceUnit.java
Fri Oct 20 04:17:45 2006
@@ -24,6 +24,7 @@
 import java.util.Map;
 
 import javax.jbi.JBIException;
+import javax.jbi.management.DeploymentException;
 import javax.jbi.management.LifeCycleMBean;
 
 public class ServiceUnit {
@@ -129,10 +130,18 @@
         return this.endpoints.values();
     }
 
-    public void addEndpoint(Endpoint endpoint) {
+    public void addEndpoint(Endpoint endpoint) throws DeploymentException {
         String key = EndpointSupport.getKey(endpoint);
         if (this.endpoints.put(key, endpoint) != null) {
-            throw new IllegalStateException("More than one endpoint found in the SU for key:
" + key);
+            throw new DeploymentException(
+                    "More than one endpoint found in the SU for key: " + key);
+        }
+        if (this.status == LifeCycleMBean.STARTED) {
+            try {
+                endpoint.activate();
+            } catch (Exception e) {
+                throw new DeploymentException(e);
+            }
         }
     }
 

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/wsdl1/AbstractWsdl1Deployer.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/wsdl1/AbstractWsdl1Deployer.java?view=diff&rev=466064&r1=466063&r2=466064
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/wsdl1/AbstractWsdl1Deployer.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/wsdl1/AbstractWsdl1Deployer.java
Fri Oct 20 04:17:45 2006
@@ -17,7 +17,6 @@
 package org.apache.servicemix.common.wsdl1;
 
 import org.apache.servicemix.common.AbstractDeployer;
-import org.apache.servicemix.common.BaseComponent;
 import org.apache.servicemix.common.Endpoint;
 import org.apache.servicemix.common.ServiceMixComponent;
 import org.apache.servicemix.common.ServiceUnit;



Mime
View raw message