summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Campo2008-02-12 08:01:39 (EST)
committerChristian Campo2008-02-12 08:01:39 (EST)
commit047b3d931cc60ceeac0c705ced6e7809235399fd (patch)
treebb2caa754cef160729aca606026b91b8ff45138f
parent5d9e5af95d146d2fd742acd1a708de75beeeb4d5 (diff)
downloadorg.eclipse.riena-047b3d931cc60ceeac0c705ced6e7809235399fd.zip
org.eclipse.riena-047b3d931cc60ceeac0c705ced6e7809235399fd.tar.gz
org.eclipse.riena-047b3d931cc60ceeac0c705ced6e7809235399fd.tar.bz2
changed to new Service Injector concept
-rw-r--r--org.eclipse.riena.core/src/org/eclipse/riena/core/logging/LogUtil.java28
1 files changed, 10 insertions, 18 deletions
diff --git a/org.eclipse.riena.core/src/org/eclipse/riena/core/logging/LogUtil.java b/org.eclipse.riena.core/src/org/eclipse/riena/core/logging/LogUtil.java
index a898273..75789fd 100644
--- a/org.eclipse.riena.core/src/org/eclipse/riena/core/logging/LogUtil.java
+++ b/org.eclipse.riena.core/src/org/eclipse/riena/core/logging/LogUtil.java
@@ -13,10 +13,8 @@ package org.eclipse.riena.core.logging;
import org.eclipse.equinox.log.ExtendedLogReaderService;
import org.eclipse.equinox.log.ExtendedLogService;
import org.eclipse.equinox.log.Logger;
-import org.eclipse.riena.core.service.ServiceInjector;
+import org.eclipse.riena.core.service.ServiceId;
import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
/**
* Wrapper to access the existing Logger.
@@ -50,8 +48,8 @@ public class LogUtil {
*
* @param logService
*/
- public void bindLogService(LogService logServiceParm) {
- logService = (ExtendedLogService) logServiceParm;
+ public void bind(ExtendedLogService logServiceParm) {
+ logService = logServiceParm;
}
/**
@@ -59,10 +57,8 @@ public class LogUtil {
*
* @param logService
*/
- public void unbindLogService(LogService logServiceParm) {
- if (logService == logServiceParm) {
- logService = null;
- }
+ public void unbind(ExtendedLogService logServiceParm) {
+ logService = null;
}
/**
@@ -70,8 +66,8 @@ public class LogUtil {
*
* @param logReaderService
*/
- public void bindLogReaderService(LogReaderService logReaderService) {
- this.logReaderService = (ExtendedLogReaderService) logReaderService;
+ public void bind(ExtendedLogReaderService logReaderService) {
+ this.logReaderService = logReaderService;
// TODO remove SysoLogListener if we have Log4jLogListener
this.logReaderService.addLogListener(new SysoLogListener(), new AlwaysFilter());
this.logReaderService.addLogListener(new Log4jLogListener(), new AlwaysFilter());
@@ -83,18 +79,14 @@ public class LogUtil {
* @param logReaderService
*/
public void unbindLogReaderService(ExtendedLogReaderService logReaderService) {
- if (this.logReaderService == logReaderService) {
- this.logReaderService = null;
- }
+ this.logReaderService = null;
}
/**
* initialize LogUtil
*/
public void init() {
- new ServiceInjector(context, ExtendedLogService.class.getName(), this, "bindLogService", "unbindLogService")
- .start();
- new ServiceInjector(context, ExtendedLogReaderService.class.getName(), this, "bindLogReaderService",
- "unbindLogReaderService").start();
+ new ServiceId(ExtendedLogService.class.getName()).useRanking().injectInto(this).start(context);
+ new ServiceId(ExtendedLogReaderService.class.getName()).useRanking().injectInto(this).start(context);
}
}