servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1381486 - /servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
Date Thu, 06 Sep 2012 07:26:37 GMT
Author: ffang
Date: Thu Sep  6 07:26:37 2012
New Revision: 1381486

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

Modified:
    servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java

Modified: servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java?rev=1381486&r1=1381485&r2=1381486&view=diff
==============================================================================
--- servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
(original)
+++ servicemix/components/trunk/engines/servicemix-camel/src/main/java/org/apache/servicemix/camel/osgi/OsgiJbiComponent.java
Thu Sep  6 07:26:37 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