felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r825141 - /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
Date Wed, 14 Oct 2009 14:06:01 GMT
Author: gnodet
Date: Wed Oct 14 14:06:00 2009
New Revision: 825141

URL: http://svn.apache.org/viewvc?rev=825141&view=rev
Log:
FELIX-1593: Got an exception when restarting FileInstall bundle

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java?rev=825141&r1=825140&r2=825141&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
Wed Oct 14 14:06:00 2009
@@ -184,7 +184,7 @@
 
     private static Logger getLogger(BundleContext context)
     {
-        if (logger != null)
+        if (logger != null && logger.isValidLogger(context))
         {
             return logger;
         }
@@ -203,11 +203,16 @@
 
     interface Logger
     {
+        boolean isValidLogger(BundleContext context);
         void log(boolean debug, java.lang.String message, java.lang.Throwable throwable);
     }
 
     static class StdOutLogger implements Logger
     {
+        public boolean isValidLogger(BundleContext context)
+        {
+            return true;
+        }
         public void log(boolean debug, String message, Throwable throwable)
         {
             System.out.println(message + (throwable == null ? "" : ": " + throwable));
@@ -237,6 +242,11 @@
             }
         }
 
+        public boolean isValidLogger(BundleContext context)
+        {
+            return context == this.context;
+        }
+
         public void log(boolean debug, String message, Throwable throwable)
         {
             LogService log = getLogService();



Mime
View raw message