[jboss-cvs] JBossAS SVN: r95271 - in projects/jboss-osgi/trunk: distribution/installer/src/main/resources/runtime/server/conf and 3 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Oct 21 04:56:15 EDT 2009


Author: thomas.diesler at jboss.com
Date: 2009-10-21 04:56:14 -0400 (Wed, 21 Oct 2009)
New Revision: 95271

Modified:
   projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
   projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
   projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
   projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
   projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
Log:
Fix slf4j runtime logging

Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml	2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/jbossas/jboss-beans-jbossmc.xml	2009-10-21 08:56:14 UTC (rev 95271)
@@ -21,8 +21,9 @@
         <entry><key>org.osgi.framework.storage.clean</key><value>onFirstInit</value></entry>
         <entry><key>org.osgi.framework.system.packages.extra</key><value>
           
-          <!-- log4j -->
+          <!-- loging -->
           org.apache.log4j;version=1.2,
+          org.slf4j;version=1.5,
             
           <!-- jboss -->
           org.jboss.beans.metadata.plugins;version=2.0,

Modified: projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml	2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/distribution/installer/src/main/resources/runtime/server/conf/jboss-osgi-bootstrap.xml	2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
           <!-- [JBOSGI-145]  JAXB classes are loaded from the system classpath -->
           com.sun.xml.internal.bind.v2,
           
-          <!-- log4j -->
+          <!-- loging -->
           org.apache.log4j;version=1.2,
+          org.slf4j;version=1.5,
           
           <!-- jboss -->
           org.jboss.beans.metadata.plugins;version=2.0,

Modified: projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java
===================================================================
--- projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java	2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/reactor/framework/src/main/java/org/jboss/osgi/framework/plugins/internal/FrameworkEventsPluginImpl.java	2009-10-21 08:56:14 UTC (rev 95271)
@@ -26,8 +26,10 @@
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.Map.Entry;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CopyOnWriteArrayList;
@@ -63,26 +65,28 @@
    // Provide logging
    final Logger log = Logger.getLogger(FrameworkEventsPluginImpl.class);
 
-   /** The executor service */
-   private ExecutorService executorService;
-   
-   /** True for synchronous event delivery */
-   private boolean synchronous;
-
    /** The bundle listeners */
    private final Map<Bundle, List<BundleListener>> bundleListeners = new ConcurrentHashMap<Bundle, List<BundleListener>>();
-
    /** The framework listeners */
    private final Map<Bundle, List<FrameworkListener>> frameworkListeners = new ConcurrentHashMap<Bundle, List<FrameworkListener>>();
-
    /** The service listeners */
    private final Map<Bundle, List<ServiceListenerRegistration>> serviceListeners = new ConcurrentHashMap<Bundle, List<ServiceListenerRegistration>>();
 
+   /** The executor service */
+   private ExecutorService executorService;
+   /** True for synchronous event delivery */
+   private boolean synchronous;
+   /** The set of bundle events taht cause an info log */
+   private Set<Integer> infoEvents = new HashSet<Integer>();
+   
    public FrameworkEventsPluginImpl(OSGiBundleManager bundleManager)
    {
       super(bundleManager);
-
-      this.executorService = Executors.newCachedThreadPool();
+      executorService = Executors.newCachedThreadPool();
+      infoEvents.add(new Integer(BundleEvent.INSTALLED));
+      infoEvents.add(new Integer(BundleEvent.STARTED));
+      infoEvents.add(new Integer(BundleEvent.STOPPED));
+      infoEvents.add(new Integer(BundleEvent.UNINSTALLED));
    }
 
    public void setSynchronous(boolean synchronous)
@@ -258,7 +262,10 @@
       final BundleEvent event = new OSGiBundleEvent(type, assertBundle(bundle));
       final String typeName = ConstantsHelper.bundleEvent(event.getType());
 
-      log.info("Bundle " + typeName + ": " + bundle);
+      if (infoEvents.contains(event.getType()))
+         log.info("Bundle " + typeName + ": " + bundle);
+      else
+         log.debug("Bundle " + typeName + ": " + bundle);
 
       // Nobody is interested
       if (listeners.isEmpty())

Modified: projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/testsuite/example/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
           <!-- [JBOSGI-145]  JAXB classes are loaded from the system classpath -->
           com.sun.xml.internal.bind.v2,
           
-          <!-- log4j -->
+          <!-- loging -->
           org.apache.log4j;version=1.2,
+          org.slf4j;version=1.5,
           
           <!-- jboss -->
           org.jboss.beans.metadata.plugins;version=2.0,

Modified: projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml
===================================================================
--- projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-21 08:55:06 UTC (rev 95270)
+++ projects/jboss-osgi/trunk/testsuite/functional/src/test/resources/META-INF/jboss-osgi-bootstrap.xml	2009-10-21 08:56:14 UTC (rev 95271)
@@ -22,8 +22,9 @@
           <!-- [JBOSGI-145]  JAXB classes are loaded from the system classpath -->
           com.sun.xml.internal.bind.v2,
           
-          <!-- log4j -->
+          <!-- loging -->
           org.apache.log4j;version=1.2,
+          org.slf4j;version=1.5,
           
           <!-- jboss -->
           org.jboss.beans.metadata.plugins;version=2.0,




More information about the jboss-cvs-commits mailing list