felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sfre...@apache.org
Subject svn commit: r668561 - /felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java
Date Tue, 17 Jun 2008 08:29:30 GMT
Author: sfrenot
Date: Tue Jun 17 01:29:30 2008
New Revision: 668561

URL: http://svn.apache.org/viewvc?rev=668561&view=rev
Log:
FELIX-598
---------
Fix of a bug introduced at revision 664691.
Logs were not working anymore.


Modified:
    felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java

Modified: felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java
URL: http://svn.apache.org/viewvc/felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java?rev=668561&r1=668560&r2=668561&view=diff
==============================================================================
--- felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java
(original)
+++ felix/trunk/mosgi/jmx.remotelogger/src/main/java/org/apache/felix/mosgi/jmx/remotelogger/Logger.java
Tue Jun 17 01:29:30 2008
@@ -57,7 +57,6 @@
   private static final String[] LOG_LVL=new String[] {"","ERROR  ","WARNING ","INFO   ","DEBUG
 "};
   private Integer logLvl=new Integer(4);
 
-  private MBeanServer agent=null;
   private ObjectName remoteLoggerON=null;
 
   /////////////////////////////////
@@ -97,15 +96,11 @@
       case ServiceEvent.REGISTERED :
         if (as[0].equals(LogReaderService.class.getName())){
           this.registerLogReaderService(servicereference);
-        }else if (as[0].equals(MBeanServer.class.getName())){
-          //this.registerToAgent(servicereference);
         }
 	break;
       case ServiceEvent.UNREGISTERING :
         if (as[0].equals(LogReaderService.class.getName())){
 	  this.unRegisterLogReaderService(servicereference);
-        }else if (as[0].equals(MBeanServer.class.getName())){
-          //this.unRegisterFromAgent();
         }
 	break;
     }
@@ -120,7 +115,7 @@
 
   public void logged(LogEntry log, boolean oldLog){
     synchronized (logMutex){
-      if (log.getLevel() <= logLvl.intValue() & this.agent!=null) {
+      if (log.getLevel() <= logLvl.intValue() ) {
         String reg=new String("*");
         StringBuffer message=new StringBuffer();
         try{
@@ -155,6 +150,11 @@
     this.log(LogService.LOG_INFO, "Remote Logger starting "+version);
 
     java.util.Properties p = new java.util.Properties();
+    try {
+      this.remoteLoggerON = new ObjectName(Logger.REMOTE_LOGGER_ON_STRING);
+    } catch (MalformedObjectNameException mne) {
+      throw new BundleException("Logger.Logger:objectName invalid", mne);
+    }
     p.put(org.apache.felix.mosgi.jmx.agent.Constants.OBJECTNAME, REMOTE_LOGGER_ON_STRING);
     this.mbean_sr = this.bc.registerService(LoggerMBean.class.getName(), this, p);
 
@@ -180,10 +180,6 @@
       this.lrs.removeLogListener(this);
       this.bc.removeServiceListener(this);
     }
-    if (this.agent!=null){
-      //this.unRegisterFromAgent();
-    }
-    this.agent=null;
     this.lrs=null; 
     this.log(LogService.LOG_INFO, "Remote Logger stopped"+version);
     this.mbean_sr.unregister();



Mime
View raw message