You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2007/03/13 22:18:56 UTC

svn commit: r517876 - /incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java

Author: gnodet
Date: Tue Mar 13 14:18:55 2007
New Revision: 517876

URL: http://svn.apache.org/viewvc?view=rev&rev=517876
Log:
SM-532: Allow easier deployment of endpoints using servicemix-common by splitting components from endpoints and put all endpoints together
Preliminary work: improve support for endpoints / global service unit between init / start

Modified:
    incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java

Modified: incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java?view=diff&rev=517876&r1=517875&r2=517876
==============================================================================
--- incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java (original)
+++ incubator/servicemix/trunk/common/servicemix-common/src/main/java/org/apache/servicemix/common/DefaultComponent.java Tue Mar 13 14:18:55 2007
@@ -286,7 +286,9 @@
                 }
                 addEndpoint(endpoint);
             }
-            getRegistry().registerServiceUnit(getServiceUnit());
+        }
+        if (serviceUnit != null) {
+            getRegistry().registerServiceUnit(serviceUnit);
         }
     }
 
@@ -299,6 +301,9 @@
         validateEndpoint(endpoint);
         endpoint.validate();
         su.addEndpoint(endpoint);
+        if (registry.getServiceUnit(su.getName()) != null) {
+            registry.registerEndpoint(endpoint);
+        }
     }
 
 
@@ -329,6 +334,9 @@
     protected void doStart() throws Exception {
         super.doStart();
         if (serviceUnit != null) {
+            if (registry.getServiceUnit(serviceUnit.getName()) == null) {
+                registry.registerServiceUnit(serviceUnit);
+            }
             serviceUnit.start();
         }
     }