Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Frost2011-06-14 12:49:39 -0400
committerChristopher Frost2011-06-14 12:49:39 -0400
commit5f810fe9277908dd9843f56c4809cf44873a4710 (patch)
tree444c1c6106dca2887f811194c069e59d145493f3
parent3b7bfa9c8eeccdf56156af34983498316f65b500 (diff)
downloadorg.eclipse.virgo.medic-5f810fe9277908dd9843f56c4809cf44873a4710.tar.gz
org.eclipse.virgo.medic-5f810fe9277908dd9843f56c4809cf44873a4710.tar.xz
org.eclipse.virgo.medic-5f810fe9277908dd9843f56c4809cf44873a4710.zip
Moving service registration unget to the correct place
-rw-r--r--org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
index 75f7023..19fbed9 100644
--- a/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
+++ b/org.eclipse.virgo.medic.core/src/main/java/org/eclipse/virgo/medic/impl/MedicActivator.java
@@ -86,6 +86,8 @@ public final class MedicActivator implements BundleActivator {
private volatile LogBackEventLoggerFactory eventLoggerFactory;
private volatile DumpContributorPublisher dumpContributorPublisher;
+
+ private volatile ServiceReference<LogReaderService> logReaderReference;
private volatile PrintStream sysOut;
@@ -107,15 +109,14 @@ public final class MedicActivator implements BundleActivator {
eventLogStart(context);
dumpStart(context, configurationProvider);
- ServiceReference<LogReaderService> logReaderReference = context.getServiceReference(LogReaderService.class);
- LogReaderService logReader = context.getService(logReaderReference);
+ this.logReaderReference = context.getServiceReference(LogReaderService.class);
+ LogReaderService logReader = context.getService(this.logReaderReference);
logReader.addLogListener(new OSGiLogServiceListener(LoggerFactory.getLogger(LogService.class)));
- context.ungetService(logReaderReference);
}
public void stop(BundleContext context) throws Exception {
this.registrationTracker.unregisterAll();
-
+ context.ungetService(this.logReaderReference);
dumpStop();
logStop(context);
}

Back to the top