Author: thomas.diesler(a)jboss.com
Date: 2009-09-01 15:37:59 -0400 (Tue, 01 Sep 2009)
New Revision: 93089
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
Log:
don't log if this BundleContext is no longer valid.
Modified:
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java
===================================================================
---
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-09-01
19:25:09 UTC (rev 93088)
+++
projects/jboss-osgi/projects/bundles/common/trunk/src/main/java/org/jboss/osgi/common/log/SystemLogService.java 2009-09-01
19:37:59 UTC (rev 93089)
@@ -68,9 +68,18 @@
private void logInternal(ServiceReference sref, int level, String message, Throwable
exception)
{
+ Bundle bundle;
+ try
+ {
+ bundle = context.getBundle();
+ }
+ catch (IllegalStateException ex)
+ {
+ // If this BundleContext is no longer valid.
+ return;
+ }
+
long time = System.currentTimeMillis();
- Bundle bundle = context.getBundle();
-
String bndStr = bundle.getSymbolicName();
String srefStr = null;
Show replies by date