summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Liebig2008-02-12 08:14:57 (EST)
committerStefan Liebig2008-02-12 08:14:57 (EST)
commit9dbd3031ff4cbed044e4b9d9a1f02325bb395f1e (patch)
treed28ff48f930f69d1e1776b57848854e9df15370d
parentb8dfdfe81532a22d064ce8c13f24e5164620ae06 (diff)
downloadorg.eclipse.riena-9dbd3031ff4cbed044e4b9d9a1f02325bb395f1e.zip
org.eclipse.riena-9dbd3031ff4cbed044e4b9d9a1f02325bb395f1e.tar.gz
org.eclipse.riena-9dbd3031ff4cbed044e4b9d9a1f02325bb395f1e.tar.bz2
uses new service injector
-rw-r--r--org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java21
-rw-r--r--org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/CommunicationConsole.java8
2 files changed, 13 insertions, 16 deletions
diff --git a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
index 593017b..f027c7a 100644
--- a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
+++ b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/Activator.java
@@ -18,7 +18,8 @@ import org.eclipse.riena.communication.core.IRemoteServiceRegistry;
import org.eclipse.riena.communication.core.publisher.IServicePublishEventDispatcher;
import org.eclipse.riena.communication.core.publisher.RSDPublisherProperties;
import org.eclipse.riena.core.logging.LogUtil;
-import org.eclipse.riena.core.service.ServiceInjector;
+import org.eclipse.riena.core.service.Injector;
+import org.eclipse.riena.core.service.ServiceId;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceRegistration;
@@ -26,8 +27,8 @@ import org.osgi.framework.ServiceRegistration;
public class Activator implements BundleActivator {
private ServiceRegistration consoleReg;
- private ServiceInjector publisherInjector;
- private ServiceInjector registryInjector;
+ private Injector publisherInjector;
+ private Injector registryInjector;
private LogUtil logUtil;
private static BundleContext CONTEXT;
private static Activator plugin;
@@ -45,15 +46,11 @@ public class Activator implements BundleActivator {
// the filter applies only if the service is living in this container
// e.g. server.
String filter = "(" + RSDPublisherProperties.PROP_IS_REMOTE + "=true)";
- publisherInjector = new ServiceInjector(context, IServicePublishEventDispatcher.ID, filter, console,
- "bindServicePublisher", "unbindServicePublisher");
- publisherInjector.start();
- registryInjector = new ServiceInjector(context, IRemoteServiceRegistry.ID, console, "bindServiceRegistry",
- "unbindServiceRegistry");
- registryInjector.start();
+ publisherInjector = new ServiceId(IServicePublishEventDispatcher.ID).useFilter(filter).injectInto(console)
+ .start(context);
+ registryInjector = new ServiceId(IRemoteServiceRegistry.ID).injectInto(console).start(context);
consoleReg = context.registerService(CommandProvider.class.getName(), console, new Hashtable<String, String>());
-
}
/*
@@ -62,9 +59,9 @@ public class Activator implements BundleActivator {
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
- publisherInjector.dispose();
+ publisherInjector.stop();
publisherInjector = null;
- registryInjector.dispose();
+ registryInjector.stop();
registryInjector = null;
consoleReg.unregister();
consoleReg = null;
diff --git a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/CommunicationConsole.java b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/CommunicationConsole.java
index c709c7c..175ae90 100644
--- a/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/CommunicationConsole.java
+++ b/org.eclipse.riena.communication.console/src/org/eclipse/riena/internal/communication/console/CommunicationConsole.java
@@ -89,7 +89,7 @@ public class CommunicationConsole implements CommandProvider {
* @param servicePublisher
* the servicePublisher to bind
*/
- public void bindServicePublisher(IServicePublishEventDispatcher servicePublisher) {
+ public void bind(IServicePublishEventDispatcher servicePublisher) {
this.servicePublisher = servicePublisher;
}
@@ -97,7 +97,7 @@ public class CommunicationConsole implements CommandProvider {
* @param servicePublisher
* the servicePublisher to unbind
*/
- public void unbindServicePublisher(IServicePublishEventDispatcher servicePublisher) {
+ public void unbind(IServicePublishEventDispatcher servicePublisher) {
this.servicePublisher = null;
}
@@ -105,7 +105,7 @@ public class CommunicationConsole implements CommandProvider {
* @param serviceRegistry
* the serviceRegistry to bind
*/
- public void bindServiceRegistry(IRemoteServiceRegistry serviceRegistry) {
+ public void bind(IRemoteServiceRegistry serviceRegistry) {
this.serviceRegistry = serviceRegistry;
}
@@ -113,7 +113,7 @@ public class CommunicationConsole implements CommandProvider {
* @param serviceRegistry
* the serviceRegistry to unbind
*/
- public void unbindServiceRegistry(IRemoteServiceRegistry serviceRegistry) {
+ public void unbind(IRemoteServiceRegistry serviceRegistry) {
this.serviceRegistry = null;
}