Author: gnodet
Date: Tue Jan 19 10:08:36 2010
New Revision: 900715

URL: http://svn.apache.org/viewvc?rev=900715&view=rev
Log:
FELIX-1995: Spring status does not show properly after osgi:list command

Modified:
    
felix/trunk/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/SpringStateListenerFactory.java

Modified: 
felix/trunk/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/SpringStateListenerFactory.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/SpringStateListenerFactory.java?rev=900715&r1=900714&r2=900715&view=diff
==============================================================================
--- 
felix/trunk/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/SpringStateListenerFactory.java
 (original)
+++ 
felix/trunk/karaf/shell/osgi/src/main/java/org/apache/felix/karaf/shell/osgi/SpringStateListenerFactory.java
 Tue Jan 19 10:08:36 2010
@@ -64,7 +64,11 @@
 
     private BundleStateListener createListener() {
         try {
-            return new SpringApplicationListener(bundleContext);
+            // Use dynamic class loading to make sure we actually try to 
reload the class for
+            // dynamic imports to kick in   if possible
+            Class cl = 
getClass().getClassLoader().loadClass("org.apache.felix.karaf.shell.osgi.SpringStateListenerFactory$SpringApplicationListener");
+            return (BundleStateListener) 
cl.getConstructor(BundleContext.class).newInstance(bundleContext);
+//            return new SpringApplicationListener(bundleContext);
         } catch (Throwable t) {
             return null;
         }


Reply via email to