servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1381564 - in /servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel: JbiComponent.java osgi/OsgiJbiComponent.java
Date Thu, 06 Sep 2012 11:44:29 GMT
Author: ffang
Date: Thu Sep  6 11:44:28 2012
New Revision: 1381564

URL: http://svn.apache.org/viewvc?rev=1381564&view=rev
Log:
[SMXCOMP-945]OsgiJbiComponent should use camel ServiceSupport to manage the lifecycle

Modified:
    servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
    servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java

Modified: servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
URL: http://svn.apache.org/viewvc/servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java?rev=1381564&r1=1381563&r2=1381564&view=diff
==============================================================================
--- servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
(original)
+++ servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/JbiComponent.java
Thu Sep  6 11:44:28 2012
@@ -16,14 +16,17 @@
  */
 package org.apache.servicemix.camel;
 
+import java.util.Map;
+
 import javax.xml.namespace.QName;
 
 import org.apache.camel.*;
+import org.apache.camel.impl.DefaultComponent;
 import org.apache.camel.processor.UnitOfWorkProcessor;
 import org.apache.servicemix.common.util.URIResolver;
 import org.apache.servicemix.id.IdGenerator;
 
-public class JbiComponent implements Component {
+public class JbiComponent extends DefaultComponent {
 
     private CamelComponent camelJbiComponent;
     private CamelContext camelContext;
@@ -169,4 +172,10 @@ public class JbiComponent implements Com
         }
         return processor;
     }
+
+    @Override
+    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters)
+        throws Exception {
+        return createEndpoint(uri);
+    }
 }

Modified: servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
URL: http://svn.apache.org/viewvc/servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java?rev=1381564&r1=1381563&r2=1381564&view=diff
==============================================================================
--- servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
(original)
+++ servicemix/components/branches/components-2011.02.x/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
Thu Sep  6 11:44:28 2012
@@ -21,18 +21,19 @@ import org.apache.servicemix.camel.JbiCo
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.ServiceReference;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.InitializingBean;
+
 
 /**
  * OSGi-specific servicemix-camel {@link JbiComponent} implementation that looks up the {@link
CamelComponent} in the OSGi Service Registry
  */
-public class OsgiJbiComponent extends JbiComponent implements InitializingBean, DisposableBean
{
+public class OsgiJbiComponent extends JbiComponent {
 
     private BundleContext bundleContext;
     private ServiceReference reference;
 
-    public void afterPropertiesSet() throws Exception {
+    @Override
+    public void start() throws Exception {
+        super.start();
         // get the servicemix-camel bundle's context
         bundleContext = FrameworkUtil.getBundle(OsgiJbiComponent.class).getBundleContext();
         
@@ -45,7 +46,9 @@ public class OsgiJbiComponent extends Jb
         setCamelJbiComponent(component);
     }
 
-    public void destroy() throws Exception {
+    @Override
+    public void stop() throws Exception {
+        super.stop();
         if (reference != null) {
             bundleContext.ungetService(reference);
         }



Mime
View raw message