diff options
author | slewis | 2009-06-25 01:04:44 +0000 |
---|---|---|
committer | slewis | 2009-06-25 01:04:44 +0000 |
commit | f114265d63cce638ec4a29fecd5a2e352e989f30 (patch) | |
tree | dff5d26a533beb57764e3cb6bf929cc8bd54eb8e /examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs | |
parent | 71cc2073f173e036787efd84a494a55e907e5e36 (diff) | |
download | org.eclipse.ecf-f114265d63cce638ec4a29fecd5a2e352e989f30.tar.gz org.eclipse.ecf-f114265d63cce638ec4a29fecd5a2e352e989f30.tar.xz org.eclipse.ecf-f114265d63cce638ec4a29fecd5a2e352e989f30.zip |
Fixed source code formatting
Diffstat (limited to 'examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs')
-rw-r--r-- | examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs/src/org/eclipse/ecf/internal/examples/remoteservices/hello/consumer/rs/Activator.java | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs/src/org/eclipse/ecf/internal/examples/remoteservices/hello/consumer/rs/Activator.java b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs/src/org/eclipse/ecf/internal/examples/remoteservices/hello/consumer/rs/Activator.java index d8e7f4e98..0bf4c230b 100644 --- a/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs/src/org/eclipse/ecf/internal/examples/remoteservices/hello/consumer/rs/Activator.java +++ b/examples/bundles/org.eclipse.ecf.examples.remoteservices.hello.consumer.rs/src/org/eclipse/ecf/internal/examples/remoteservices/hello/consumer/rs/Activator.java @@ -18,38 +18,48 @@ import org.osgi.util.tracker.ServiceTracker; public class Activator implements BundleActivator { public static final String RSGI_SERVICE_HOST = "r-osgi://localhost:9278"; - + private BundleContext context; private ServiceTracker containerManagerServiceTracker; private IContainer container; - + /* * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) + * + * @see + * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) */ public void start(BundleContext context) throws Exception { this.context = context; // Create R-OSGi Container IContainerManager containerManager = getContainerManagerService(); - container = containerManager.getContainerFactory().createContainer("ecf.r_osgi.peer"); + container = containerManager.getContainerFactory().createContainer( + "ecf.r_osgi.peer"); // Get remote service container adapter - IRemoteServiceContainerAdapter containerAdapter = (IRemoteServiceContainerAdapter) container.getAdapter(IRemoteServiceContainerAdapter.class); + IRemoteServiceContainerAdapter containerAdapter = (IRemoteServiceContainerAdapter) container + .getAdapter(IRemoteServiceContainerAdapter.class); // Lookup IRemoteServiceReference - IRemoteServiceReference[] helloReferences = containerAdapter.getRemoteServiceReferences(IDFactory.getDefault().createID(container.getConnectNamespace(),RSGI_SERVICE_HOST), IHello.class.getName(), null); + IRemoteServiceReference[] helloReferences = containerAdapter + .getRemoteServiceReferences(IDFactory.getDefault().createID( + container.getConnectNamespace(), RSGI_SERVICE_HOST), + IHello.class.getName(), null); Assert.isNotNull(helloReferences); Assert.isTrue(helloReferences.length > 0); // Get remote service for reference - IRemoteService remoteService = containerAdapter.getRemoteService(helloReferences[0]); + IRemoteService remoteService = containerAdapter + .getRemoteService(helloReferences[0]); // Get the proxy IHello proxy = (IHello) remoteService.getProxy(); // Finally...call the proxy proxy.hello("RemoteService Consumer"); - + } /* * (non-Javadoc) - * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) + * + * @see + * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) */ public void stop(BundleContext context) throws Exception { if (container != null) { @@ -59,13 +69,14 @@ public class Activator implements BundleActivator { if (containerManagerServiceTracker != null) { containerManagerServiceTracker.close(); containerManagerServiceTracker = null; - } + } this.context = null; } private IContainerManager getContainerManagerService() { if (containerManagerServiceTracker == null) { - containerManagerServiceTracker = new ServiceTracker(context, IContainerManager.class.getName(),null); + containerManagerServiceTracker = new ServiceTracker(context, + IContainerManager.class.getName(), null); containerManagerServiceTracker.open(); } return (IContainerManager) containerManagerServiceTracker.getService(); |