You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2011/12/10 04:57:20 UTC

svn commit: r1212726 - in /cxf/trunk: api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java

Author: dkulp
Date: Sat Dec 10 03:57:20 2011
New Revision: 1212726

URL: http://svn.apache.org/viewvc?rev=1212726&view=rev
Log:
BusLifeCycleListener is usless as a global service as it doesn't get the
Bus passed in.  Introduce a new interface that can be used to get
noticed when Bus's are created and can then register additional
BusLifeCycleListeners for the finer events.

Added:
    cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java   (with props)
Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java

Added: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java?rev=1212726&view=auto
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java (added)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java Sat Dec 10 03:57:20 2011
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.buslifecycle;
+
+import org.apache.cxf.Bus;
+
+/**
+ * The listener interface for receiving notification of when <code>Bus</code>
+ * objects are created.
+ *
+ * It's a simplified form of BusLifeCycleListener that takes the 
+ * target Bus as a parameter which is appropriate if the listener needs 
+ * to be a singleton that works with multiple Bus objects.   
+ * 
+ * A common pattern would be to register a full BusLifeCycleListener on the
+ * target Bus to receive full Bus events
+ */
+public interface BusCreationListener {
+
+    /**
+     * Invoked to create a BusLifeCycleListener.   
+     */
+    void busCreated(Bus b);
+    
+}

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1212726&r1=1212725&r2=1212726&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Sat Dec 10 03:57:20 2011
@@ -27,6 +27,7 @@ import java.util.concurrent.CopyOnWriteA
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
+import org.apache.cxf.buslifecycle.BusCreationListener;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
 import org.apache.cxf.configuration.ConfiguredBeanLocator;
@@ -161,6 +162,13 @@ public class CXFBusImpl extends Abstract
 
     public void initialize() {
         setState(BusState.INITIALIZING);
+        
+        Collection<? extends BusCreationListener> ls = getExtension(ConfiguredBeanLocator.class)
+            .getBeansOfType(BusCreationListener.class);
+        for (BusCreationListener l : ls) {
+            l.busCreated(this);
+        }
+        
         doInitializeInternal();
         
         BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java?rev=1212726&r1=1212725&r2=1212726&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java Sat Dec 10 03:57:20 2011
@@ -40,6 +40,7 @@ import org.apache.cxf.bus.extension.Exte
 import org.apache.cxf.bus.extension.ExtensionManagerImpl;
 import org.apache.cxf.bus.extension.ExtensionRegistry;
 import org.apache.cxf.bus.osgi.OSGiAutomaticWorkQueue.WorkQueueList;
+import org.apache.cxf.buslifecycle.BusCreationListener;
 import org.apache.cxf.buslifecycle.BusLifeCycleListener;
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
 import org.apache.cxf.common.logging.LogUtils;
@@ -215,13 +216,14 @@ public class OSGiExtensionLocator implem
             
             try {
                 ServiceReference refs[] = defaultContext
-                    .getServiceReferences(BusLifeCycleListener.class.getName(), null);
+                    .getServiceReferences(ClientLifeCycleListener.class.getName(), null);
                 if (refs != null) {
+                    ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
                     for (ServiceReference ref : refs) {
                         if (allowService(ref)) {
-                            BusLifeCycleListener listener 
-                                = (BusLifeCycleListener)defaultContext.getService(ref);
-                            manager.registerLifeCycleListener(listener);
+                            ClientLifeCycleListener listener 
+                                = (ClientLifeCycleListener)defaultContext.getService(ref);
+                            clcm.registerListener(listener);
                         }
                     }
                 }
@@ -230,36 +232,37 @@ public class OSGiExtensionLocator implem
             }
             try {
                 ServiceReference refs[] = defaultContext
-                    .getServiceReferences(ClientLifeCycleListener.class.getName(), null);
+                    .getServiceReferences(ServerLifeCycleListener.class.getName(), null);
                 if (refs != null) {
-                    ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
+                    ServerLifeCycleManager clcm = bus.getExtension(ServerLifeCycleManager.class);
                     for (ServiceReference ref : refs) {
                         if (allowService(ref)) {
-                            ClientLifeCycleListener listener 
-                                = (ClientLifeCycleListener)defaultContext.getService(ref);
+                            ServerLifeCycleListener listener 
+                                = (ServerLifeCycleListener)defaultContext.getService(ref);
                             clcm.registerListener(listener);
                         }
                     }
                 }
+                
             } catch (InvalidSyntaxException e) {
                 //ignore
             }
             try {
                 ServiceReference refs[] = defaultContext
-                    .getServiceReferences(ServerLifeCycleListener.class.getName(), null);
+                    .getServiceReferences(BusCreationListener.class.getName(), null);
                 if (refs != null) {
-                    ServerLifeCycleManager clcm = bus.getExtension(ServerLifeCycleManager.class);
                     for (ServiceReference ref : refs) {
                         if (allowService(ref)) {
-                            ServerLifeCycleListener listener 
-                                = (ServerLifeCycleListener)defaultContext.getService(ref);
-                            clcm.registerListener(listener);
+                            BusCreationListener listener 
+                                = (BusCreationListener)defaultContext.getService(ref);
+                            listener.busCreated(bus);
                         }
                     }
                 }
             } catch (InvalidSyntaxException e) {
                 //ignore
             }
+
         }
         
         private boolean allowService(ServiceReference ref) {



Re: svn commit: r1212726 - in /cxf/trunk: api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java

Posted by Aki Yoshida <el...@googlemail.com>.
2011/12/11 Daniel Kulp <dk...@apache.org>:
> On Sunday, December 11, 2011 1:37:46 AM Aki Yoshida wrote:
>> Hi Dan,
>> I have a suspicion that one of r1212724, r1212725, r1212726 from today
>> has introduced some problem. A very simple osgi cxf spring bundle that
>> worked before is suddenly getting the following exception at its
>> start-up.
>>
>> osgi> Exception in thread "SpringOsgiExtenderThread-16"
>> org.springframework.beans.factory.BeanCreationException: Error
>> creating bean with name 'cxf' defined in OSGi
>> resource[classpath:META-INF/cxf/cxf.xml|bnd.id=104|bnd.sym=tmp.test-osgi-cxf
>> -consumer]: Initialization of bean failed; nested exception is
>> java.lang.NoClassDefFoundError:
>> org/eclipse/jetty/util/component/Container$Listener
>
>
> I think I fixed this.   Can you give it a try and let me know if it works?
>
> Thanks!

Hi Dan,
thanks.
I just sync'ed the trunk and the problem seems to have gone away.
it works fine.

thanks.
regards, aki

>
>
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com

Re: svn commit: r1212726 - in /cxf/trunk: api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java

Posted by Daniel Kulp <dk...@apache.org>.
On Sunday, December 11, 2011 1:37:46 AM Aki Yoshida wrote:
> Hi Dan,
> I have a suspicion that one of r1212724, r1212725, r1212726 from today
> has introduced some problem. A very simple osgi cxf spring bundle that
> worked before is suddenly getting the following exception at its
> start-up.
> 
> osgi> Exception in thread "SpringOsgiExtenderThread-16"
> org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'cxf' defined in OSGi
> resource[classpath:META-INF/cxf/cxf.xml|bnd.id=104|bnd.sym=tmp.test-osgi-cxf
> -consumer]: Initialization of bean failed; nested exception is
> java.lang.NoClassDefFoundError:
> org/eclipse/jetty/util/component/Container$Listener


I think I fixed this.   Can you give it a try and let me know if it works?

Thanks!


Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com

Re: svn commit: r1212726 - in /cxf/trunk: api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java

Posted by Aki Yoshida <el...@googlemail.com>.
Hi Dan,
I have a suspicion that one of r1212724, r1212725, r1212726 from today
has introduced some problem. A very simple osgi cxf spring bundle that
worked before is suddenly getting the following exception at its
start-up.

osgi> Exception in thread "SpringOsgiExtenderThread-16"
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'cxf' defined in OSGi
resource[classpath:META-INF/cxf/cxf.xml|bnd.id=104|bnd.sym=tmp.test-osgi-cxf-consumer]:
Initialization of bean failed; nested exception is
java.lang.NoClassDefFoundError:
org/eclipse/jetty/util/component/Container$Listener
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$1600(AbstractDelegatedExecutionApplicationContext.java:69)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:355)
        at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
        at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NoClassDefFoundError:
org/eclipse/jetty/util/component/Container$Listener
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
        at java.lang.Class.getDeclaredMethod(Class.java:1935)
        at org.apache.cxf.configuration.spring.ConfigurerImpl.getBeanName(ConfigurerImpl.java:199)
        at org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:124)
        at org.apache.cxf.configuration.spring.ConfigurerImpl.configureBean(ConfigurerImpl.java:111)
        at org.apache.cxf.bus.extension.ExtensionManagerImpl.loadAndRegister(ExtensionManagerImpl.java:195)
        at org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeansOfType(ExtensionManagerImpl.java:290)
        at org.apache.cxf.bus.spring.SpringBeanLocator.getBeansOfType(SpringBeanLocator.java:138)
        at org.apache.cxf.buslifecycle.CXFBusLifeCycleManager.initComplete(CXFBusLifeCycleManager.java:78)
        at org.apache.cxf.bus.CXFBusImpl.initialize(CXFBusImpl.java:176)
        at org.apache.cxf.bus.spring.SpringBus.setApplicationContext(SpringBus.java:101)
        at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:109)
        at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:88)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1413)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        ... 13 more
Caused by: java.lang.ClassNotFoundException:
org.eclipse.jetty.util.component.Container$Listener
        at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429)
        at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417)
        at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 30 more


I was wondering if there is some change that is now looking up for
org.eclipse.jetty.util.component.Container somehow. If so, this is a
problem because I have tomcat and no jetty stuff.

Thanks.

regards, aki

2011/12/10  <dk...@apache.org>:
> Author: dkulp
> Date: Sat Dec 10 03:57:20 2011
> New Revision: 1212726
>
> URL: http://svn.apache.org/viewvc?rev=1212726&view=rev
> Log:
> BusLifeCycleListener is usless as a global service as it doesn't get the
> Bus passed in.  Introduce a new interface that can be used to get
> noticed when Bus's are created and can then register additional
> BusLifeCycleListeners for the finer events.
>
> Added:
>    cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java   (with props)
> Modified:
>    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
>    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java
>
> Added: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java?rev=1212726&view=auto
> ==============================================================================
> --- cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java (added)
> +++ cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java Sat Dec 10 03:57:20 2011
> @@ -0,0 +1,42 @@
> +/**
> + * Licensed to the Apache Software Foundation (ASF) under one
> + * or more contributor license agreements. See the NOTICE file
> + * distributed with this work for additional information
> + * regarding copyright ownership. The ASF licenses this file
> + * to you under the Apache License, Version 2.0 (the
> + * "License"); you may not use this file except in compliance
> + * with the License. You may obtain a copy of the License at
> + *
> + * http://www.apache.org/licenses/LICENSE-2.0
> + *
> + * Unless required by applicable law or agreed to in writing,
> + * software distributed under the License is distributed on an
> + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> + * KIND, either express or implied. See the License for the
> + * specific language governing permissions and limitations
> + * under the License.
> + */
> +
> +package org.apache.cxf.buslifecycle;
> +
> +import org.apache.cxf.Bus;
> +
> +/**
> + * The listener interface for receiving notification of when <code>Bus</code>
> + * objects are created.
> + *
> + * It's a simplified form of BusLifeCycleListener that takes the
> + * target Bus as a parameter which is appropriate if the listener needs
> + * to be a singleton that works with multiple Bus objects.
> + *
> + * A common pattern would be to register a full BusLifeCycleListener on the
> + * target Bus to receive full Bus events
> + */
> +public interface BusCreationListener {
> +
> +    /**
> +     * Invoked to create a BusLifeCycleListener.
> +     */
> +    void busCreated(Bus b);
> +
> +}
>
> Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
> ------------------------------------------------------------------------------
>    svn:eol-style = native
>
> Propchange: cxf/trunk/api/src/main/java/org/apache/cxf/buslifecycle/BusCreationListener.java
> ------------------------------------------------------------------------------
>    svn:keywords = Rev Date
>
> Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java?rev=1212726&r1=1212725&r2=1212726&view=diff
> ==============================================================================
> --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java (original)
> +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/CXFBusImpl.java Sat Dec 10 03:57:20 2011
> @@ -27,6 +27,7 @@ import java.util.concurrent.CopyOnWriteA
>
>  import org.apache.cxf.Bus;
>  import org.apache.cxf.BusFactory;
> +import org.apache.cxf.buslifecycle.BusCreationListener;
>  import org.apache.cxf.buslifecycle.BusLifeCycleManager;
>  import org.apache.cxf.common.injection.NoJSR250Annotations;
>  import org.apache.cxf.configuration.ConfiguredBeanLocator;
> @@ -161,6 +162,13 @@ public class CXFBusImpl extends Abstract
>
>     public void initialize() {
>         setState(BusState.INITIALIZING);
> +
> +        Collection<? extends BusCreationListener> ls = getExtension(ConfiguredBeanLocator.class)
> +            .getBeansOfType(BusCreationListener.class);
> +        for (BusCreationListener l : ls) {
> +            l.busCreated(this);
> +        }
> +
>         doInitializeInternal();
>
>         BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
>
> Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java
> URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java?rev=1212726&r1=1212725&r2=1212726&view=diff
> ==============================================================================
> --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java (original)
> +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/osgi/OSGiExtensionLocator.java Sat Dec 10 03:57:20 2011
> @@ -40,6 +40,7 @@ import org.apache.cxf.bus.extension.Exte
>  import org.apache.cxf.bus.extension.ExtensionManagerImpl;
>  import org.apache.cxf.bus.extension.ExtensionRegistry;
>  import org.apache.cxf.bus.osgi.OSGiAutomaticWorkQueue.WorkQueueList;
> +import org.apache.cxf.buslifecycle.BusCreationListener;
>  import org.apache.cxf.buslifecycle.BusLifeCycleListener;
>  import org.apache.cxf.buslifecycle.BusLifeCycleManager;
>  import org.apache.cxf.common.logging.LogUtils;
> @@ -215,13 +216,14 @@ public class OSGiExtensionLocator implem
>
>             try {
>                 ServiceReference refs[] = defaultContext
> -                    .getServiceReferences(BusLifeCycleListener.class.getName(), null);
> +                    .getServiceReferences(ClientLifeCycleListener.class.getName(), null);
>                 if (refs != null) {
> +                    ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
>                     for (ServiceReference ref : refs) {
>                         if (allowService(ref)) {
> -                            BusLifeCycleListener listener
> -                                = (BusLifeCycleListener)defaultContext.getService(ref);
> -                            manager.registerLifeCycleListener(listener);
> +                            ClientLifeCycleListener listener
> +                                = (ClientLifeCycleListener)defaultContext.getService(ref);
> +                            clcm.registerListener(listener);
>                         }
>                     }
>                 }
> @@ -230,36 +232,37 @@ public class OSGiExtensionLocator implem
>             }
>             try {
>                 ServiceReference refs[] = defaultContext
> -                    .getServiceReferences(ClientLifeCycleListener.class.getName(), null);
> +                    .getServiceReferences(ServerLifeCycleListener.class.getName(), null);
>                 if (refs != null) {
> -                    ClientLifeCycleManager clcm = bus.getExtension(ClientLifeCycleManager.class);
> +                    ServerLifeCycleManager clcm = bus.getExtension(ServerLifeCycleManager.class);
>                     for (ServiceReference ref : refs) {
>                         if (allowService(ref)) {
> -                            ClientLifeCycleListener listener
> -                                = (ClientLifeCycleListener)defaultContext.getService(ref);
> +                            ServerLifeCycleListener listener
> +                                = (ServerLifeCycleListener)defaultContext.getService(ref);
>                             clcm.registerListener(listener);
>                         }
>                     }
>                 }
> +
>             } catch (InvalidSyntaxException e) {
>                 //ignore
>             }
>             try {
>                 ServiceReference refs[] = defaultContext
> -                    .getServiceReferences(ServerLifeCycleListener.class.getName(), null);
> +                    .getServiceReferences(BusCreationListener.class.getName(), null);
>                 if (refs != null) {
> -                    ServerLifeCycleManager clcm = bus.getExtension(ServerLifeCycleManager.class);
>                     for (ServiceReference ref : refs) {
>                         if (allowService(ref)) {
> -                            ServerLifeCycleListener listener
> -                                = (ServerLifeCycleListener)defaultContext.getService(ref);
> -                            clcm.registerListener(listener);
> +                            BusCreationListener listener
> +                                = (BusCreationListener)defaultContext.getService(ref);
> +                            listener.busCreated(bus);
>                         }
>                     }
>                 }
>             } catch (InvalidSyntaxException e) {
>                 //ignore
>             }
> +
>         }
>
>         private boolean allowService(ServiceReference ref) {
>
>