diff options
author | slewis | 2016-02-29 04:01:17 +0000 |
---|---|---|
committer | slewis | 2016-02-29 04:01:17 +0000 |
commit | 3a7d06b0edb1db6be9f59bffc6b6aa04e71243bd (patch) | |
tree | 85722a490050eb614e8e27d266a84548c7b73f12 /framework | |
parent | d3cde81353070d732dd828a24a511594d6fb4b9f (diff) | |
download | org.eclipse.ecf-3a7d06b0edb1db6be9f59bffc6b6aa04e71243bd.tar.gz org.eclipse.ecf-3a7d06b0edb1db6be9f59bffc6b6aa04e71243bd.tar.xz org.eclipse.ecf-3a7d06b0edb1db6be9f59bffc6b6aa04e71243bd.zip |
Simplification of new RSA remote service API.
Change-Id: Ia3020ff508eb9539c1b1075a781c54c53d79eef5
Diffstat (limited to 'framework')
3 files changed, 10 insertions, 75 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java index a2f7a7616..da67aa379 100644 --- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java +++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/AbstractRSAContainer.java @@ -38,15 +38,7 @@ public abstract class AbstractRSAContainer extends AbstractContainer { protected abstract void unregisterEndpoint(RSARemoteServiceRegistration registration); protected RSARemoteServiceContainerAdapter createContainerAdapter() { - return new RSARemoteServiceContainerAdapter(this, new IRSAHostContainerAdapter() { - public void unregisterEndpoint(RSARemoteServiceRegistration registration) { - AbstractRSAContainer.this.unregisterEndpoint(registration); - } - - public Map<String, Object> registerEndpoint(RSARemoteServiceRegistration registration) { - return AbstractRSAContainer.this.registerEndpoint(registration); - } - }); + return new RSARemoteServiceContainerAdapter(this); } public void connect(ID targetID, IConnectContext connectContext) throws ContainerConnectException { diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/IRSAHostContainerAdapter.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/IRSAHostContainerAdapter.java deleted file mode 100644 index 26fcc0b6a..000000000 --- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/IRSAHostContainerAdapter.java +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************* -* Copyright (c) 2016 Composent, Inc. and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -******************************************************************************/ -package org.eclipse.ecf.remoteservice; - -import java.util.Map; -import org.eclipse.ecf.remoteservice.RSARemoteServiceContainerAdapter.RSARemoteServiceRegistration; - -/** - * Interface for Remote Service Admin container adapters. Defines API for registering - * and unregistering RSA endpoints. See RSARemoteServiceContainerAdapter for implementation. - * @since 8.9 - */ -public interface IRSAHostContainerAdapter { - - /** - * Register an endpoint via some distribution system. Implementers - * should implement this method to register an endpoint. Optionally return a Map<String, Object> - * that will be used to override properties in the RSA EndpointDescription. - * - * @param registration containing information about service to be registered as an endpoint. Will not - * be <code>null</code>. - * - * @return Map<String,Object> containing properties and values. If non-null, any properties - * present will be added to the RSA Endpoint Description. If the properties have ECF-standardized - * values (e.g. ecf.endpoint.id) the standardized values will be overridden in the endpoint - * description to have the values provided by this Map. May be null, if no properties are to - * override or be added to the RSA endpoint description. - */ - Map<String, Object> registerEndpoint(RSARemoteServiceRegistration registration); - - /** - * Unregister an endpoint via distribution system used to register as per registerEndpoint - * method above. After this method completes, any/all resources allocated by registerEndpoint - * should be released. - * - * @param registration RSARemoteServiceRegistration previously registered via registerEndpoint. - * Will not be <code>null</code>. - */ - void unregisterEndpoint(RSARemoteServiceRegistration registration); - -} diff --git a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java index 6f760a44f..dabb99bfd 100644 --- a/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java +++ b/framework/bundles/org.eclipse.ecf.remoteservice/src/org/eclipse/ecf/remoteservice/RSARemoteServiceContainerAdapter.java @@ -11,7 +11,6 @@ package org.eclipse.ecf.remoteservice; import java.util.Dictionary; import java.util.Map; -import org.eclipse.ecf.core.IContainer; import org.eclipse.equinox.concurrent.future.IExecutor; /** @@ -23,18 +22,18 @@ import org.eclipse.equinox.concurrent.future.IExecutor; * * @since 8.9 */ -public class RSARemoteServiceContainerAdapter extends RemoteServiceContainerAdapterImpl implements IRSAHostContainerAdapter { +public class RSARemoteServiceContainerAdapter extends RemoteServiceContainerAdapterImpl { - private final IRSAHostContainerAdapter rsaAdapter; - - public RSARemoteServiceContainerAdapter(IContainer container, IExecutor executor, IRSAHostContainerAdapter rsaAdapter) { + public RSARemoteServiceContainerAdapter(AbstractRSAContainer container, IExecutor executor) { super(container, executor); - this.rsaAdapter = rsaAdapter; } - public RSARemoteServiceContainerAdapter(IContainer container, IRSAHostContainerAdapter rsaAdapter) { + public RSARemoteServiceContainerAdapter(AbstractRSAContainer container) { super(container); - this.rsaAdapter = rsaAdapter; + } + + protected AbstractRSAContainer getRSAContainer() { + return (AbstractRSAContainer) super.getContainer(); } @Override @@ -50,11 +49,11 @@ public class RSARemoteServiceContainerAdapter extends RemoteServiceContainerAdap @Override public void publish(RemoteServiceRegistryImpl reg, Object svc, String[] clzzes, Dictionary props) { super.publish(reg, svc, clzzes, props); - this.extraProperties = registerEndpoint(this); + this.extraProperties = getRSAContainer().registerEndpoint(this); } public void unregister() { - unregisterEndpoint(this); + getRSAContainer().unregisterEndpoint(this); } public Map<String, Object> getExtraProperties() { @@ -62,12 +61,4 @@ public class RSARemoteServiceContainerAdapter extends RemoteServiceContainerAdap } } - public Map<String, Object> registerEndpoint(RSARemoteServiceRegistration registration) { - return (rsaAdapter != null) ? rsaAdapter.registerEndpoint(registration) : null; - } - - public void unregisterEndpoint(RSARemoteServiceRegistration registration) { - if (rsaAdapter != null) - rsaAdapter.unregisterEndpoint(registration); - } } |