Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2018-04-26 14:49:15 -0400
committerslewis2018-04-26 14:49:15 -0400
commitbb502c0711a9e6581e4bfe24cf1e25eb56f661d5 (patch)
tree8c87e42f9db42bb12013f127bb830e3a81bf0657
parent17430fa3d4ac4f168a6a596db5702d0284953141 (diff)
downloadorg.eclipse.ecf-bb502c0711a9e6581e4bfe24cf1e25eb56f661d5.tar.gz
org.eclipse.ecf-bb502c0711a9e6581e4bfe24cf1e25eb56f661d5.tar.xz
org.eclipse.ecf-bb502c0711a9e6581e4bfe24cf1e25eb56f661d5.zip
Update to rosgi to allow use of asm 6 and removed
org.eclipse.ecf.remoteservice.rpc code (deprecated in preference to the github.com XmlRpcRemoteServiceProvider. Change-Id: I352d2e79e027c10eedf2c26e54b12193bec3d2b5
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/META-INF/MANIFEST.MF33
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/README.md5
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/build.properties1
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/Activator.java100
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/RpcClientContainerInstantiator.java66
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/RpcException.java29
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientContainer.java57
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientService.java131
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/TrivialParameterServializer.java53
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcId.java29
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcNamespace.java96
-rw-r--r--framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/server/RemoteServiceXmlRpcServlet.java42
-rw-r--r--protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF4
-rw-r--r--protocols/bundles/ch.ethz.iks.r_osgi.remote/pom.xml2
-rw-r--r--protocols/bundles/ch.ethz.iks.slp/.classpath2
-rw-r--r--protocols/bundles/ch.ethz.iks.slp/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--protocols/bundles/ch.ethz.iks.slp/META-INF/MANIFEST.MF4
-rw-r--r--protocols/bundles/ch.ethz.iks.slp/pom.xml2
-rw-r--r--protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/OSGiPlatformAbstraction.java1
-rw-r--r--releng/features/org.eclipse.ecf.remoteservice.rpc.feature/README.md5
-rw-r--r--releng/features/org.eclipse.ecf.remoteservice.rpc.feature/feature.xml23
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF20
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/README.md5
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/apache/xmlrpc/webserver/XmlRpcServlet.properties10
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java109
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/HttpServiceConnector.java58
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/CalcHandler.java21
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/EchoHandler.java20
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/AbstractRpcTestCase.java47
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcConstants.java37
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerInstantiatorTest.java58
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerTest.java53
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcNamespaceTest.java43
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceAdapterTest.java99
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceTest.java143
-rw-r--r--tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/common/IEcho.java15
36 files changed, 31 insertions, 1403 deletions
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/META-INF/MANIFEST.MF
index 652352a89..4411bdc72 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/META-INF/MANIFEST.MF
@@ -3,43 +3,12 @@ Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.remoteservice.rpc;singleton:=true
Automatic-Module-Name: org.eclipse.ecf.remoteservice.rpc
-Bundle-Version: 1.2.100.qualifier
-Bundle-Activator: org.eclipse.ecf.internal.remoteservice.rpc.Activator
+Bundle-Version: 1.3.0.qualifier
Bundle-Vendor: %plugin.provider
Require-Bundle: org.eclipse.ecf,
org.eclipse.equinox.common
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Import-Package: javax.servlet;version="2.6.0",
- javax.servlet.http;version="2.6.0",
- org.apache.commons.httpclient;version="3.1.0",
- org.apache.commons.httpclient.auth;version="3.1.0",
- org.apache.commons.httpclient.methods;version="3.1.0",
- org.apache.commons.httpclient.params;version="3.1.0",
- org.apache.commons.httpclient.util;version="3.1.0",
- org.apache.xmlrpc,
- org.apache.xmlrpc.client,
- org.apache.xmlrpc.client.util,
- org.apache.xmlrpc.common,
- org.apache.xmlrpc.parser,
- org.apache.xmlrpc.serializer,
- org.apache.xmlrpc.server,
- org.apache.xmlrpc.webserver,
- org.eclipse.ecf.core;version="3.0.0",
- org.eclipse.ecf.core.identity;version="3.0.0",
- org.eclipse.ecf.core.provider,
- org.eclipse.ecf.remoteservice;version="6.0.0",
- org.eclipse.ecf.remoteservice.asyncproxy,
- org.eclipse.ecf.remoteservice.client,
- org.eclipse.equinox.concurrent.future;version="1.1.0",
- org.osgi.framework,
- org.osgi.service.log;version="1.3.0",
- org.osgi.util.tracker
-Export-Package: org.eclipse.ecf.internal.remoteservice.rpc;x-internal:=true,
- org.eclipse.ecf.remoteservice.rpc;version="1.0.0",
- org.eclipse.ecf.remoteservice.rpc.client;version="1.0.0",
- org.eclipse.ecf.remoteservice.rpc.identity;version="1.0.0",
- org.eclipse.ecf.remoteservice.rpc.server
Bundle-Localization: plugin
DynamicImport-Package: *
Provide-Capability: osgi.remoteserviceadmin.distribution; configs:List<String>="ecf.xmlrpc.client"; version:Version=1.1
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/README.md b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/README.md
new file mode 100644
index 000000000..018a80a5d
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/README.md
@@ -0,0 +1,5 @@
+Note: This plugin has been deprecated in favor of the xmlrpc remote services provider available
+here:
+
+https://github.com/ECF/XmlRpcProvider
+
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/build.properties b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/build.properties
index 16d547646..8c730610e 100644
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/build.properties
+++ b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/build.properties
@@ -12,3 +12,4 @@ bin.includes = META-INF/,\
plugin.xml,\
plugin.properties
jars.extra.classpath = platform:/plugin/org.eclipse.equinox.concurrent
+jre.compilation.profile = J2SE-1.4
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/Activator.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/Activator.java
deleted file mode 100644
index fb346dfaf..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/Activator.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.remoteservice.rpc;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.SafeRunner;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.util.*;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcNamespace;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.service.log.LogService;
-import org.osgi.util.tracker.ServiceTracker;
-
-public class Activator implements BundleActivator {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.ecf.remoteservice.rpc"; //$NON-NLS-1$
-
- // The shared instance
- private static Activator plugin;
-
- private static BundleContext context;
-
- private ServiceTracker logServiceTracker = null;
-
- private LogService logService = null;
-
- static BundleContext getContext() {
- return context;
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(final BundleContext bundleContext) throws Exception {
- plugin = this;
- Activator.context = bundleContext;
- SafeRunner.run(new ExtensionRegistryRunnable(bundleContext) {
- protected void runWithoutRegistry() throws Exception {
- bundleContext.registerService(Namespace.class, new RpcNamespace(), null);
- bundleContext.registerService(ContainerTypeDescription.class, new ContainerTypeDescription(
- "ecf.xmlrpc.client", new RpcClientContainerInstantiator(), "Rpc Client Container"), null); //$NON-NLS-1$ //$NON-NLS-2$
- }
- });
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- if (logServiceTracker != null) {
- logServiceTracker.close();
- logServiceTracker = null;
- logService = null;
- }
- plugin = null;
- Activator.context = null;
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static synchronized Activator getDefault() {
- if (plugin == null) {
- plugin = new Activator();
- }
- return plugin;
- }
-
- protected LogService getLogService() {
- if (logServiceTracker == null) {
- logServiceTracker = new ServiceTracker(Activator.context, LogService.class.getName(), null);
- logServiceTracker.open();
- }
- logService = (LogService) logServiceTracker.getService();
- if (logService == null)
- logService = new SystemLogService(PLUGIN_ID);
- return logService;
- }
-
- public void log(IStatus status) {
- if (logService == null)
- logService = getLogService();
- if (logService != null)
- logService.log(LogHelper.getLogCode(status), LogHelper.getLogMessage(status), status.getException());
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/RpcClientContainerInstantiator.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/RpcClientContainerInstantiator.java
deleted file mode 100644
index 248b63a74..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/internal/remoteservice/rpc/RpcClientContainerInstantiator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.remoteservice.rpc;
-
-import java.util.*;
-import org.eclipse.ecf.core.*;
-import org.eclipse.ecf.core.identity.IDFactory;
-import org.eclipse.ecf.core.provider.BaseContainerInstantiator;
-import org.eclipse.ecf.core.provider.IRemoteServiceContainerInstantiator;
-import org.eclipse.ecf.remoteservice.rpc.client.RpcClientContainer;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcId;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcNamespace;
-
-public class RpcClientContainerInstantiator extends BaseContainerInstantiator implements
- IRemoteServiceContainerInstantiator {
-
- private static final String RPC_CONTAINER_TYPE = "ecf.xmlrpc.client"; //$NON-NLS-1$
-
- public IContainer createInstance(ContainerTypeDescription description, Object[] parameters)
- throws ContainerCreateException {
- try {
- RpcId ID = null;
- if (parameters != null && parameters[0] instanceof RpcId)
- ID = (RpcId) parameters[0];
- else
- ID = (RpcId) IDFactory.getDefault().createID(RpcNamespace.NAME, parameters);
- return new RpcClientContainer(ID);
- } catch (Exception e) {
- throw new ContainerCreateException("Could not create RPCClientContainer", e); //$NON-NLS-1$
- }
- }
-
- public String[] getSupportedAdapterTypes(ContainerTypeDescription description) {
- return getInterfacesAndAdaptersForClass(RpcClientContainer.class);
- }
-
- public Class[][] getSupportedParameterTypes(ContainerTypeDescription description) {
- RpcNamespace namespace = (RpcNamespace) IDFactory.getDefault().getNamespaceByName(RpcNamespace.NAME);
- return namespace.getSupportedParameterTypes();
- }
-
- public String[] getImportedConfigs(ContainerTypeDescription description, String[] exporterSupportedConfigs) {
- if (RPC_CONTAINER_TYPE.equals(description.getName())) {
- List supportedConfigs = Arrays.asList(exporterSupportedConfigs);
- if (supportedConfigs.contains(RPC_CONTAINER_TYPE))
- return new String[] {RPC_CONTAINER_TYPE};
- }
- return null;
- }
-
- public Dictionary getPropertiesForImportedConfigs(ContainerTypeDescription description, String[] importedConfigs,
- Dictionary exportedProperties) {
- return null;
- }
-
- public String[] getSupportedConfigs(ContainerTypeDescription description) {
- return new String[] {RPC_CONTAINER_TYPE};
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/RpcException.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/RpcException.java
deleted file mode 100644
index 1221a7abf..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/RpcException.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc;
-
-import org.eclipse.ecf.core.util.ECFException;
-
-public class RpcException extends ECFException {
-
- private static final long serialVersionUID = 5822049943586453183L;
-
- public RpcException(Throwable cause) {
- super(cause);
- }
-
- public RpcException(Throwable cause, int errorCode) {
- super(cause);
- }
-
- public RpcException(String message, Throwable cause) {
- super(message, cause);
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientContainer.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientContainer.java
deleted file mode 100644
index 344e486d0..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientContainer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.client;
-
-import org.eclipse.ecf.core.identity.IDFactory;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.remoteservice.*;
-import org.eclipse.ecf.remoteservice.client.*;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcId;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcNamespace;
-
-/**
- * A container for XML-RPC services.
- */
-// TODO add working with auth via header params (Cookies, see http://ws.apache.org/xmlrpc/server.html)
-public class RpcClientContainer extends AbstractClientContainer implements IRemoteServiceClientContainerAdapter {
-
- public RpcClientContainer(RpcId id) {
- super(id);
-
- setParameterSerializer(new TrivialParameterServializer());
- }
-
- public Namespace getConnectNamespace() {
- return IDFactory.getDefault().getNamespaceByName(RpcNamespace.NAME);
- }
-
- protected IRemoteService createRemoteService(RemoteServiceClientRegistration registration) {
- IRemoteService service = null;
- try {
- service = new RpcClientService(this, registration);
- } catch (ECFException e) {
- logException(e.getMessage(), e);
- }
-
- return service;
- }
-
- protected String prepareEndpointAddress(IRemoteCall call, IRemoteCallable callable) {
- // For XML-RPC, endpoint == resource.path
- return callable.getResourcePath();
- }
-
- public boolean setRemoteServiceCallPolicy(IRemoteServiceCallPolicy policy) {
- // By default, XML-RPC client cannot set the call policy, so
- // return false
- return false;
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientService.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientService.java
deleted file mode 100644
index 308056ea2..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/RpcClientService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.client;
-
-import java.io.NotSerializableException;
-import java.net.MalformedURLException;
-import org.apache.xmlrpc.client.*;
-import org.apache.xmlrpc.client.util.ClientFactory;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.internal.remoteservice.rpc.Activator;
-import org.eclipse.ecf.remoteservice.IRemoteCall;
-import org.eclipse.ecf.remoteservice.client.*;
-import org.eclipse.ecf.remoteservice.rpc.RpcException;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcId;
-
-public class RpcClientService extends AbstractClientService {
-
- private XmlRpcClient client;
-
- public RpcClientService(RpcClientContainer container, RemoteServiceClientRegistration registration)
- throws RpcException {
- super(container, registration);
- client = getXmlRpcClient();
- }
-
- protected XmlRpcClientConfig getXmlRpcClientConfig() throws RpcException {
- try {
- RpcId id = (RpcId) container.getID();
-
- XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
- config.setServerURL(id.toURI().toURL());
- config.setEnabledForExtensions(true);
- // Set default timeouts
- config.setConnectionTimeout(60 * 1000);
- config.setReplyTimeout(60 * 1000);
-
- return config;
- } catch (MalformedURLException e) {
- handleException(e.getMessage(), e);
- return null;
- }
- }
-
- protected XmlRpcClient getXmlRpcClient() throws RpcException {
- XmlRpcClient xmlRpcClient = new XmlRpcClient();
- xmlRpcClient.setConfig(getXmlRpcClientConfig());
- xmlRpcClient.setTransportFactory(new XmlRpcCommonsTransportFactory(xmlRpcClient));
-
- return xmlRpcClient;
- }
-
- /**
- * Create a Dynamic Proxy for using XML-RPC servers, which builded on Apache XML-RPC.
- */
- public Object createProxy(ClassLoader cl, Class[] classes) {
- if (classes == null || classes.length < 1)
- return null;
-
- ClientFactory factory = new ClientFactory(client);
- return factory.newInstance(classes[0]);
- }
-
- /**
- * Create a Dynamic Proxy for using XML-RPC servers, which builded on Apache XML-RPC.
- * See the <a href="http://ws.apache.org/xmlrpc/advanced.html">Dynamic proxies</a> section.
- */
- protected Object createProxy(Class[] classes) {
- if (classes == null || classes.length < 1)
- return null;
-
- ClientFactory factory = new ClientFactory(client);
- return factory.newInstance(classes[0]);
- }
-
- /**
- * Calls the XML-RPC Service with given operation of IRemoteCall. The returned value is
- * the returned value from server
- *
- * @param call The remote call to make. Must not be <code>null</code>.
- * @param callable The callable with default parameters to use to make the call.
- * @return The XML-RPC Service's return value
- */
- protected Object invokeRemoteCall(final IRemoteCall call, final IRemoteCallable callable) throws ECFException {
- String operation = prepareEndpointAddress(call, callable);
- Object result = null;
- try {
- result = client.execute(operation, toObjectsArray(operation, call, callable));
- } catch (Exception e) {
- handleException("Exception while executing method:" + operation, e); //$NON-NLS-1$
- }
-
- return result;
- }
-
- protected void handleException(String message, Throwable e) throws RpcException {
- logException(message, e);
- throw new RpcException(message, e);
- }
-
- protected Object[] toObjectsArray(String uri, IRemoteCall call, IRemoteCallable callable)
- throws NotSerializableException {
- IRemoteCallParameter[] rpcParameters = prepareParameters(uri, call, callable);
- Object[] result = new Object[rpcParameters.length];
- for (int i = 0; i < rpcParameters.length; i++) {
- result[i] = rpcParameters[i].getValue();
- }
-
- return result;
- }
-
- protected void logException(String string, Throwable e) {
- Activator a = Activator.getDefault();
- if (a != null)
- a.log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, string, e));
- }
-
- protected void logWarning(String string, Throwable e) {
- Activator a = Activator.getDefault();
- if (a != null)
- a.log(new Status(IStatus.WARNING, Activator.PLUGIN_ID, string));
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/TrivialParameterServializer.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/TrivialParameterServializer.java
deleted file mode 100644
index 5258bc21b..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/client/TrivialParameterServializer.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.client;
-
-import java.io.NotSerializableException;
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.ecf.remoteservice.IRemoteCall;
-import org.eclipse.ecf.remoteservice.client.*;
-
-/**
- * Trivial parameter serializer - just copy a parameter value
- *
- * @author psamolisov
- */
-public class TrivialParameterServializer implements IRemoteCallParameterSerializer {
-
- /**
- * @throws NotSerializableException
- */
- public IRemoteCallParameter[] serializeParameter(String endpoint, IRemoteCall call, IRemoteCallable callable,
- IRemoteCallParameter[] currentParameters, Object[] paramToSerialize) throws NotSerializableException {
- List results = new ArrayList();
- if (paramToSerialize != null) {
- for (int i = 0; i < paramToSerialize.length; i++) {
- IRemoteCallParameter p = new RemoteCallParameter(currentParameters[i].getName(),
- paramToSerialize[i] == null ? currentParameters[i].getValue() : paramToSerialize[i]);
- results.add(p);
- }
- }
- return (IRemoteCallParameter[]) results.toArray(new IRemoteCallParameter[results.size()]);
- }
-
- /**
- * All parameters will be serialized in the Apache XML-RPC library. We shouldn't serialize any parameters
- * by default.
- *
- * @return the parameter value
- */
- public IRemoteCallParameter serializeParameter(String endpoint, IRemoteCall call, IRemoteCallable callable,
- IRemoteCallParameter paramDefault, Object paramToSerialize) {
- // Just return a parameter
- return new RemoteCallParameter(paramDefault.getName(), paramToSerialize == null ? paramDefault.getValue()
- : paramToSerialize);
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcId.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcId.java
deleted file mode 100644
index 14b2c33be..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcId.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.identity;
-
-import java.net.URI;
-import org.eclipse.ecf.core.identity.Namespace;
-import org.eclipse.ecf.core.identity.URIID;
-
-public class RpcId extends URIID {
-
- private static final long serialVersionUID = -713344242499901489L;
-
- public RpcId(Namespace namespace, URI uri) {
- super(namespace, uri);
- }
-
- public String toString() {
- StringBuffer sb = new StringBuffer("XmlRpcId["); //$NON-NLS-1$
- sb.append(getName()).append("]"); //$NON-NLS-1$
- return sb.toString();
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcNamespace.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcNamespace.java
deleted file mode 100644
index a11199906..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/identity/RpcNamespace.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.identity;
-
-import java.net.URI;
-import java.net.URL;
-import java.util.*;
-import org.eclipse.ecf.core.identity.*;
-import org.eclipse.ecf.remoteservice.rpc.client.RpcClientContainer;
-
-/**
- * This class represents a {@link Namespace} for {@link RpcClientContainer}s.
- */
-public class RpcNamespace extends Namespace {
-
- private static final long serialVersionUID = -4255624538742281975L;
-
- /**
- * The name of this namespace.
- */
- public static final String NAME = "ecf.xmlrpc.namespace"; //$NON-NLS-1$
-
- /**
- * The scheme of this namespace.
- */
- public static final String SCHEME = "xmlrpc"; //$NON-NLS-1$
-
- public RpcNamespace() {
- super(NAME, "Rpc Namespace"); //$NON-NLS-1$
- }
-
- public RpcNamespace(String name, String desc) {
- super(name, desc);
- }
-
- private String getInitFromExternalForm(Object[] args) {
- if (args == null || args.length < 1 || args[0] == null)
- return null;
- if (args[0] instanceof String) {
- final String arg = (String) args[0];
- if (arg.startsWith(getScheme() + Namespace.SCHEME_SEPARATOR)) {
- final int index = arg.indexOf(Namespace.SCHEME_SEPARATOR);
- if (index >= arg.length())
- return null;
- return arg.substring(index + 1);
- }
- }
- return null;
- }
-
- /**
- * Creates an instance of an {@link RPCD}. The parameters must contain specific information.
- *
- * @param parameters a collection of attributes to call the right constructor on {@link RpcId}.
- * @return an instance of {@link RpcId}. Will not be <code>null</code>.
- */
- public ID createInstance(Object[] parameters) throws IDCreateException {
- URI uri = null;
- try {
- final String init = getInitFromExternalForm(parameters);
- if (init != null) {
- uri = URI.create(init);
- return new RpcId(this, uri);
- }
- if (parameters != null) {
- if (parameters[0] instanceof URI)
- return new RpcId(this, (URI) parameters[0]);
- else if (parameters[0] instanceof String)
- return new RpcId(this, URI.create((String) parameters[0]));
- else if (parameters[0] instanceof URL)
- return new RpcId(this, URI.create(((URL) parameters[0]).toExternalForm()));
- else if (parameters[0] instanceof RpcId)
- return (ID) parameters[0];
- }
- throw new IllegalArgumentException("Invalid parameters to RPCID creation"); //$NON-NLS-1$
- } catch (Exception e) {
- throw new IDCreateException("Could not create RPC ID", e); //$NON-NLS-1$
- }
- }
-
- public Class[][] getSupportedParameterTypes() {
- return new Class[][] { {String.class}, {Integer.class}, {Boolean.class}, {Double.class}, {Date.class},
- {byte[].class}, {Object[].class}, {List.class}, {Map.class}};
- }
-
- public String getScheme() {
- return SCHEME;
- }
-}
diff --git a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/server/RemoteServiceXmlRpcServlet.java b/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/server/RemoteServiceXmlRpcServlet.java
deleted file mode 100644
index 7d62f183b..000000000
--- a/framework/bundles/org.eclipse.ecf.remoteservice.rpc/src/org/eclipse/ecf/remoteservice/rpc/server/RemoteServiceXmlRpcServlet.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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: Pavel Samolisov - initial API and implementation
- ******************************************************************************/
-package org.eclipse.ecf.remoteservice.rpc.server;
-
-import javax.servlet.ServletConfig;
-import org.apache.xmlrpc.XmlRpcException;
-import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping;
-import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
-import org.apache.xmlrpc.webserver.XmlRpcServlet;
-import org.apache.xmlrpc.webserver.XmlRpcServletServer;
-
-public class RemoteServiceXmlRpcServlet extends XmlRpcServlet {
-
- private static final long serialVersionUID = 654171179838565650L;
-
- class RemoteServiceHandlerMapping extends AbstractReflectiveHandlerMapping {
-
- }
-
- private RemoteServiceHandlerMapping mapping;
-
- protected XmlRpcHandlerMapping newXmlRpcHandlerMapping() throws XmlRpcException {
- return (mapping == null) ? super.newXmlRpcHandlerMapping() : mapping;
- }
-
- class RemoteServiceXmlRpcServletServer extends XmlRpcServletServer {
-
- }
-
- private RemoteServiceXmlRpcServletServer server;
-
- protected XmlRpcServletServer newXmlRpcServer(ServletConfig pConfig) throws XmlRpcException {
- return (server == null) ? super.newXmlRpcServer(pConfig) : server;
- }
-
-}
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF b/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
index 860365a41..acd16d57f 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/META-INF/MANIFEST.MF
@@ -3,11 +3,11 @@ Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: ch.ethz.iks.r_osgi.remote
Automatic-Module-Name: ch.ethz.iks.r_osgi.remote
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Vendor: %plugin.provider
Import-Package: org.eclipse.ecf.remoteservice;version="7.3.0",
org.eclipse.ecf.remoteservice.asyncproxy;version="[1.0.0,3.0.0)",
- org.objectweb.asm;version="[5.0.1,6.0.0)",
+ org.objectweb.asm;version="[5.0.1,7.0.0)",
org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.service.event;version="[1.0.0,2.0.0)",
org.osgi.service.log;version="[1.0.0,2.0.0)",
diff --git a/protocols/bundles/ch.ethz.iks.r_osgi.remote/pom.xml b/protocols/bundles/ch.ethz.iks.r_osgi.remote/pom.xml
index 9d2589208..38709e0f6 100644
--- a/protocols/bundles/ch.ethz.iks.r_osgi.remote/pom.xml
+++ b/protocols/bundles/ch.ethz.iks.r_osgi.remote/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>ch.ethz.iks.r_osgi.remote</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/protocols/bundles/ch.ethz.iks.slp/.classpath b/protocols/bundles/ch.ethz.iks.slp/.classpath
index a2fe3764a..4e5804e84 100644
--- a/protocols/bundles/ch.ethz.iks.slp/.classpath
+++ b/protocols/bundles/ch.ethz.iks.slp/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="bin"/>
diff --git a/protocols/bundles/ch.ethz.iks.slp/.settings/org.eclipse.jdt.core.prefs b/protocols/bundles/ch.ethz.iks.slp/.settings/org.eclipse.jdt.core.prefs
index a8303734d..c5f58fedc 100644
--- a/protocols/bundles/ch.ethz.iks.slp/.settings/org.eclipse.jdt.core.prefs
+++ b/protocols/bundles/ch.ethz.iks.slp/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Wed May 20 23:49:38 PDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -9,15 +8,15 @@ org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.maxProblemPerUnit=100
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
@@ -26,7 +25,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
@@ -80,6 +79,6 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disa
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
diff --git a/protocols/bundles/ch.ethz.iks.slp/META-INF/MANIFEST.MF b/protocols/bundles/ch.ethz.iks.slp/META-INF/MANIFEST.MF
index 4156ae8c1..4a9cfdf55 100644
--- a/protocols/bundles/ch.ethz.iks.slp/META-INF/MANIFEST.MF
+++ b/protocols/bundles/ch.ethz.iks.slp/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2
Bundle-Name: Service Location Protocol (RFC 2608) Implementation
Bundle-SymbolicName: ch.ethz.iks.slp
Automatic-Module-Name: ch.ethz.iks.slp
-Bundle-Version: 1.1.200.qualifier
+Bundle-Version: 1.2.0.qualifier
Export-Package: ch.ethz.iks.slp;version="1.0.0"
Bundle-Activator: ch.ethz.iks.slp.impl.Activator
Bundle-Vendor: Eclipse.org - ECF
@@ -11,4 +11,4 @@ Import-Package: org.osgi.framework;version="[1.0.0,2.0.0)",
org.osgi.service.log;version="[1.0.0,2.0.0)"
Bundle-Description: jSLP, the pure Java Service Location Protocol implementation
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/protocols/bundles/ch.ethz.iks.slp/pom.xml b/protocols/bundles/ch.ethz.iks.slp/pom.xml
index 102e0ccc8..00326005a 100644
--- a/protocols/bundles/ch.ethz.iks.slp/pom.xml
+++ b/protocols/bundles/ch.ethz.iks.slp/pom.xml
@@ -10,6 +10,6 @@
</parent>
<groupId>org.eclipse.ecf</groupId>
<artifactId>ch.ethz.iks.slp</artifactId>
- <version>1.1.200-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/OSGiPlatformAbstraction.java b/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/OSGiPlatformAbstraction.java
index b630919c2..0e3a1d29f 100644
--- a/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/OSGiPlatformAbstraction.java
+++ b/protocols/bundles/ch.ethz.iks.slp/src/main/java/ch/ethz/iks/slp/impl/OSGiPlatformAbstraction.java
@@ -215,5 +215,6 @@ public class OSGiPlatformAbstraction implements PlatformAbstraction,
public void log(ServiceReference sr, int level, String message, Throwable t) {
log(null, level, message, t);
}
+
}
}
diff --git a/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/README.md b/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/README.md
new file mode 100644
index 000000000..018a80a5d
--- /dev/null
+++ b/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/README.md
@@ -0,0 +1,5 @@
+Note: This plugin has been deprecated in favor of the xmlrpc remote services provider available
+here:
+
+https://github.com/ECF/XmlRpcProvider
+
diff --git a/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/feature.xml b/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/feature.xml
index 73a84e8d6..8b98bd98f 100644
--- a/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/feature.xml
+++ b/releng/features/org.eclipse.ecf.remoteservice.rpc.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.ecf.remoteservice.rpc.feature"
label="%featureName"
- version="1.0.100.qualifier"
+ version="1.1.0.qualifier"
provider-name="%providerName">
<description url="http://www.eclipse.org/ecf">
@@ -31,25 +31,4 @@ https://wiki.eclipse.org/ECF#OSGi_Remote_Services
<import plugin="org.jdom"/>
</requires>
- <plugin
- id="org.apache.xmlrpc"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.ecf.remoteservice.rpc"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.apache.ws.commons.util"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
</feature>
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF
index d83ecca02..21c111341 100644
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF
+++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/META-INF/MANIFEST.MF
@@ -4,27 +4,7 @@ Bundle-Name: %plugin.name
Bundle-SymbolicName: org.eclipse.ecf.tests.remoteservice.rpc
Automatic-Module-Name: org.eclipse.ecf.tests.remoteservice.rpc
Bundle-Version: 1.1.100.qualifier
-Bundle-Activator: org.eclipse.ecf.internal.tests.remoteservice.rpc.Activator
Bundle-Vendor: %plugin.provider
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.ecf;bundle-version="3.1.0",
- org.eclipse.ecf.tests;bundle-version="2.1.0",
- org.eclipse.ecf.tests.remoteservice;bundle-version="2.0.0",
- org.junit;bundle-version="3.8.2",
- org.eclipse.ecf.remoteservice.rpc;bundle-version="1.0.0",
- org.apache.commons.logging;bundle-version="1.0.4",
- org.apache.ws.commons.util;bundle-version="1.0.0",
- org.apache.xmlrpc;bundle-version="3.0.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
-Import-Package: javax.servlet;version="2.5.0",
- javax.servlet.http;version="2.5.0",
- org.eclipse.ecf.remoteservice;version="6.0.0",
- org.eclipse.ecf.remoteservice.asyncproxy;version="1.0.0",
- org.eclipse.ecf.remoteservice.client;version="6.0.0",
- org.eclipse.ecf.remoteservice.events;version="6.0.0",
- org.eclipse.equinox.concurrent.future;version="1.0.0",
- org.eclipse.equinox.http.jetty;version="1.1.0",
- org.osgi.service.http;version="1.2.1"
Bundle-Localization: plugin
-Export-Package: org.eclipse.ecf.tests.remoteservice.rpc.common
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/README.md b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/README.md
new file mode 100644
index 000000000..018a80a5d
--- /dev/null
+++ b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/README.md
@@ -0,0 +1,5 @@
+Note: This plugin has been deprecated in favor of the xmlrpc remote services provider available
+here:
+
+https://github.com/ECF/XmlRpcProvider
+
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/apache/xmlrpc/webserver/XmlRpcServlet.properties b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/apache/xmlrpc/webserver/XmlRpcServlet.properties
deleted file mode 100644
index d34b15699..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/apache/xmlrpc/webserver/XmlRpcServlet.properties
+++ /dev/null
@@ -1,10 +0,0 @@
-############################################################################
-# Copyright (c) 2010-2011 Naumen, IBM Corp, 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
-############################################################################
-Echo = org.eclipse.ecf.internal.tests.remoteservice.rpc.server.EchoHandler
-Calc = org.eclipse.ecf.internal.tests.remoteservice.rpc.server.CalcHandler
-org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho = org.eclipse.ecf.internal.tests.remoteservice.rpc.server.EchoHandler \ No newline at end of file
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java
deleted file mode 100644
index efe647b02..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/Activator.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.tests.remoteservice.rpc;
-
-import javax.servlet.ServletConfig;
-
-import org.apache.xmlrpc.XmlRpcConfig;
-import org.apache.xmlrpc.server.XmlRpcHandlerMapping;
-import org.apache.xmlrpc.webserver.XmlRpcServletServer;
-import java.io.InputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.BufferedInputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import javax.servlet.ServletInputStream;
-import java.util.Enumeration;
-import java.io.IOException;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpServlet;
-import org.eclipse.equinox.http.jetty.JettyConfigurator;
-import java.util.Hashtable;
-import java.util.Dictionary;
-import org.apache.xmlrpc.webserver.XmlRpcServlet;
-import org.eclipse.ecf.tests.remoteservice.rpc.RpcConstants;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
-
- private static final String HTTP_PORT_KEY = "http.port"; //$NON-NLS-1$
-
- private static final String SERVER_NAME = "xmlrpcserver"; //$NON-NLS-1$
-
- private static BundleContext context;
-
- private HttpServiceConnector httpServiceConnector;
-
- static BundleContext getContext() {
- return context;
- }
-
- class XHttpServlet extends HttpServlet {
-
- private final XmlRpcServlet s = new XmlRpcServlet();
-
- @Override
- public void init(ServletConfig config) throws ServletException {
- // TODO Auto-generated method stub
- super.init(config);
- s.init(config);
- }
-
- @Override
- protected void doPost(HttpServletRequest req, HttpServletResponse resp)
- throws ServletException, IOException {
- //System.out.println("doPost req="+readInputStreamAsString(req.getInputStream()));
- s.doPost(req,resp);
- }
- }
-
- public static String readInputStreamAsString(InputStream in)
- throws IOException {
-
- BufferedInputStream bis = new BufferedInputStream(in);
- ByteArrayOutputStream buf = new ByteArrayOutputStream();
- int result = bis.read();
- while(result != -1) {
- byte b = (byte)result;
- buf.write(b);
- result = bis.read();
- }
- return buf.toString();
- }
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
- */
- public void start(BundleContext bundleContext) throws Exception {
- Activator.context = bundleContext;
- httpServiceConnector = new HttpServiceConnector(context, RpcConstants.TEST_SERVLETS_PATH, new XHttpServlet());
-
- Dictionary<String, Object> properties = new Hashtable<String, Object>();
- properties.put(HTTP_PORT_KEY, RpcConstants.HTTP_PORT);
- JettyConfigurator.startServer(SERVER_NAME, properties);
- }
-
- /*
- * (non-Javadoc)
- * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
- */
- public void stop(BundleContext bundleContext) throws Exception {
- Activator.context = null;
- JettyConfigurator.stopServer(SERVER_NAME);
-
- if (httpServiceConnector != null) {
- httpServiceConnector.close();
- httpServiceConnector = null;
- }
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/HttpServiceConnector.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/HttpServiceConnector.java
deleted file mode 100644
index e30910702..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/HttpServiceConnector.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.tests.remoteservice.rpc;
-
-import javax.servlet.http.HttpServlet;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.http.HttpService;
-import org.osgi.util.tracker.ServiceTracker;
-import org.osgi.util.tracker.ServiceTrackerCustomizer;
-
-@SuppressWarnings("rawtypes")
-public class HttpServiceConnector extends ServiceTracker implements ServiceTrackerCustomizer {
-
- private String path;
-
- private HttpServlet servlet;
-
- @SuppressWarnings("unchecked")
- public HttpServiceConnector(BundleContext context, String path, HttpServlet servlet) {
- super(context, HttpService.class.getName(), null);
- this.path = path;
- this.servlet = servlet;
-
- open();
- }
-
- public Object addingService(ServiceReference reference) {
- @SuppressWarnings("unchecked")
- HttpService httpService = (HttpService) super.addingService(reference);
- if (httpService == null)
- return null;
-
- try {
- httpService.registerServlet(path, servlet, null, null);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
-
- return httpService;
- }
-
- @SuppressWarnings("unchecked")
- public void removedService(ServiceReference reference, Object service) {
- HttpService httpService = (HttpService) service;
- httpService.unregister(path);
-
- super.removedService(reference, service);
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/CalcHandler.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/CalcHandler.java
deleted file mode 100644
index e09c583aa..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/CalcHandler.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.tests.remoteservice.rpc.server;
-
-public class CalcHandler {
-
- public int add(int i1, int i2) {
- return i1 + i2;
- }
-
- public int sub(int i1, int i2) {
- return i1 - i2;
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/EchoHandler.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/EchoHandler.java
deleted file mode 100644
index 89d2151e5..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/internal/tests/remoteservice/rpc/server/EchoHandler.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.internal.tests.remoteservice.rpc.server;
-
-import org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho;
-
-public class EchoHandler implements IEcho {
-
- public String echo(String str) {
- System.out.println(str); // TODO using logger
- return str;
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/AbstractRpcTestCase.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/AbstractRpcTestCase.java
deleted file mode 100644
index 199f7edc6..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/AbstractRpcTestCase.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import java.util.Dictionary;
-import org.eclipse.ecf.core.ContainerCreateException;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.core.identity.IDCreateException;
-import org.eclipse.ecf.remoteservice.IRemoteServiceRegistration;
-import org.eclipse.ecf.remoteservice.client.IRemoteCallable;
-import org.eclipse.ecf.remoteservice.client.IRemoteServiceClientContainerAdapter;
-import org.eclipse.ecf.tests.ECFAbstractTestCase;
-
-public abstract class AbstractRpcTestCase extends ECFAbstractTestCase {
-
- protected IContainer createRpcContainer(String uri) throws ContainerCreateException {
- return getContainerFactory().createContainer(RpcConstants.RPC_CONTAINER_TYPE, uri);
- }
-
- protected IContainer createRpcContainer(ID rpcId) throws ContainerCreateException {
- return getContainerFactory().createContainer(RpcConstants.RPC_CONTAINER_TYPE, rpcId);
- }
-
- protected ID createRpcID(String id) throws IDCreateException {
- return getIDFactory().createID(RpcConstants.NAMESPACE, id);
- }
-
- protected IRemoteServiceClientContainerAdapter getRemoteServiceClientContainerAdapter(IContainer container) {
- return (IRemoteServiceClientContainerAdapter) container.getAdapter(IRemoteServiceClientContainerAdapter.class);
- }
-
- protected IRemoteServiceRegistration registerCallable(IContainer container, IRemoteCallable callable, Dictionary<String, Object> properties) {
- return getRemoteServiceClientContainerAdapter(container).registerCallables(new IRemoteCallable[] { callable }, properties);
- }
-
- protected IRemoteServiceRegistration registerCallable(IContainer container, IRemoteCallable[] callables, Dictionary<String, Object> properties) {
- return getRemoteServiceClientContainerAdapter(container).registerCallables(callables, properties);
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcConstants.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcConstants.java
deleted file mode 100644
index 8306d2bca..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcConstants.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-public interface RpcConstants {
-
- public static final String RPC_CONTAINER_TYPE = "ecf.xmlrpc.client"; //$NON-NLS-1$
-
- public static final String NAMESPACE = "ecf.xmlrpc.namespace"; //$NON-NLS-1$
-
- public static final int HTTP_PORT = 8085;
-
- public static final String TEST_SERVLETS_PATH = "/xmlrpc"; //$NON-NLS-1$
-
- public static final String TEST_ECHO_TARGET = "http://localhost:" + HTTP_PORT + TEST_SERVLETS_PATH; //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final String TEST_ECHO_METHOD = "Echo.echo"; //$NON-NLS-1$
-
- public static final String TEST_ECHO_METHOD_NAME = "echo"; //$NON-NLS-1$
-
- public static final String TEST_ECHO_METHOD_PARAM = "text"; //$NON-NLS-1$
-
- public static final String TEST_CALC_PLUS_METHOD = "Calc.add"; //$NON-NLS-1$
-
- public static final String TEST_CALC_PLUS_METHOD_NAME = "plus"; //$NON-NLS-1$
-
- public static final String TEST_CALC_PLUS_METHOD_PARAM1 = "val1"; //$NON-NLS-1$
-
- public static final String TEST_CALC_PLUS_METHOD_PARAM2 = "val2"; //$NON-NLS-1$
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerInstantiatorTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerInstantiatorTest.java
deleted file mode 100644
index 8c77a756f..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerInstantiatorTest.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.IContainerFactory;
-import org.eclipse.ecf.tests.ECFAbstractTestCase;
-
-public class RpcContainerInstantiatorTest extends ECFAbstractTestCase {
-
- private IContainerFactory containerFactory;
-
- private ContainerTypeDescription description;
-
- protected void setUp() throws Exception {
- containerFactory = getContainerFactory();
- description = containerFactory.getDescriptionByName(RpcConstants.RPC_CONTAINER_TYPE);
- }
-
- public void testSupportedParameterTypes() {
- Class<?>[][] types = description.getSupportedParameterTypes();
- boolean foundString = false;
- boolean foundInteger = false;
- boolean foundBoolean = false;
- boolean foundDouble = false;
- boolean foundDate = false;
- boolean foundByteArray = false;
- boolean foundObjectArray = false;
- boolean foundList = false;
- boolean foundMap = false;
- for(int i=0; i < types.length; i++) {
- for(int j=0; j < types[i].length; j++) {
- if (types[i][j].equals(String.class)) foundString = true;
- if (types[i][j].equals(Integer.class)) foundInteger = true;
- if (types[i][j].equals(Boolean.class)) foundBoolean = true;
- if (types[i][j].equals(Double.class)) foundDouble = true;
- if (types[i][j].equals(Date.class)) foundDate = true;
- if (types[i][j].equals(byte[].class)) foundByteArray = true;
- if (types[i][j].equals(Object[].class)) foundObjectArray = true;
- if (types[i][j].equals(List.class)) foundList = true;
- if (types[i][j].equals(Map.class)) foundMap = true;
- }
- }
- assertTrue(foundString && foundInteger && foundBoolean && foundDouble && foundDate && foundByteArray
- && foundObjectArray && foundList && foundMap);
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerTest.java
deleted file mode 100644
index ef7a06f12..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcContainerTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import java.net.URI;
-import java.net.URL;
-import org.eclipse.ecf.core.ContainerTypeDescription;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.remoteservice.rpc.client.RpcClientContainer;
-
-public class RpcContainerTest extends AbstractRpcTestCase {
-
- protected void tearDown() throws Exception {
- getContainerManager().removeAllContainers();
- }
-
- public void testCreateContainer() throws Exception {
- IContainer container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
- assertNotNull(container);
- assertTrue(container instanceof RpcClientContainer);
- }
-
- public void testCreateContainer1() throws Exception {
- IContainer container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
- assertNotNull(container);
- assertTrue(container instanceof RpcClientContainer);
- }
-
- public void testCreateContainer2() throws Exception {
- ContainerTypeDescription description = getContainerFactory()
- .getDescriptionByName(RpcConstants.RPC_CONTAINER_TYPE);
- IContainer container = getContainerFactory().createContainer(description,
- new Object[] { new URL(RpcConstants.TEST_ECHO_TARGET) });
- assertNotNull(container);
- assertTrue(container instanceof RpcClientContainer);
- }
-
- public void testCreateContainer3() throws Exception {
- ContainerTypeDescription description = getContainerFactory()
- .getDescriptionByName(RpcConstants.RPC_CONTAINER_TYPE);
- IContainer container = getContainerFactory().createContainer(description,
- new Object[] { new URI(RpcConstants.TEST_ECHO_TARGET) });
- assertNotNull(container);
- assertTrue(container instanceof RpcClientContainer);
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcNamespaceTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcNamespaceTest.java
deleted file mode 100644
index 370c786b9..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcNamespaceTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.remoteservice.rpc.identity.RpcNamespace;
-
-public class RpcNamespaceTest extends AbstractRpcTestCase {
-
- public void testCreation() {
- String desc = "description";
- RpcNamespace namespace = new RpcNamespace(RpcNamespace.NAME, desc);
- assertEquals(RpcNamespace.NAME, namespace.getName());
- assertEquals(desc, namespace.getDescription());
- }
-
- public void testCreateInstance() {
- RpcNamespace namespace = new RpcNamespace(RpcNamespace.NAME, null);
- Object[] parameters;
- try {
- String url = RpcConstants.TEST_ECHO_TARGET;
- parameters = new Object[] {new URL(url)};
- ID id = namespace.createInstance(parameters);
- assertEquals(url, id.getName());
- } catch (MalformedURLException e) {
- fail();
- }
- }
-
- public void testGetScheme() {
- RpcNamespace namespace = new RpcNamespace(RpcNamespace.NAME, null);
- assertEquals(RpcNamespace.SCHEME, namespace.getScheme());
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceAdapterTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceAdapterTest.java
deleted file mode 100644
index 1bc5535e6..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceAdapterTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.remoteservice.Constants;
-import org.eclipse.ecf.remoteservice.IRemoteFilter;
-import org.eclipse.ecf.remoteservice.IRemoteService;
-import org.eclipse.ecf.remoteservice.IRemoteServiceID;
-import org.eclipse.ecf.remoteservice.IRemoteServiceListener;
-import org.eclipse.ecf.remoteservice.IRemoteServiceReference;
-import org.eclipse.ecf.remoteservice.IRemoteServiceRegistration;
-import org.eclipse.ecf.remoteservice.client.IRemoteCallable;
-import org.eclipse.ecf.remoteservice.client.IRemoteServiceClientContainerAdapter;
-import org.eclipse.ecf.remoteservice.client.RemoteCallableFactory;
-import org.eclipse.ecf.remoteservice.events.IRemoteServiceEvent;
-import org.eclipse.ecf.remoteservice.events.IRemoteServiceRegisteredEvent;
-import org.osgi.framework.InvalidSyntaxException;
-
-public class RpcRemoteServiceAdapterTest extends AbstractRpcTestCase {
-
- IContainer container;
-
- protected void setUp() throws Exception {
- super.setUp();
- container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- container.disconnect();
- container.dispose();
- getContainerManager().removeAllContainers();
- }
-
- IRemoteServiceClientContainerAdapter getRemoteServiceClientContainerAdapter() {
- return super.getRemoteServiceClientContainerAdapter(container);
- }
-
- IRemoteServiceRegistration createRpcRegistration(String method) {
- IRemoteCallable callable = RemoteCallableFactory.createCallable(method);
- return registerCallable(container, callable, null);
- }
-
- public void testGetRemoteService() {
- IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
- IRemoteServiceReference reference = registration.getReference();
- assertNotNull(reference);
- IRemoteService remoteService = getRemoteServiceClientContainerAdapter().getRemoteService(reference);
- assertNotNull(remoteService);
- }
-
- public void testGetRemoteServiceReference() {
- IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
- IRemoteServiceReference remoteServiceReference = getRemoteServiceClientContainerAdapter().getRemoteServiceReference(registration.getID());
- assertEquals(registration.getReference(), remoteServiceReference);
- }
-
- public void testUngetRemoteService() {
- IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
- IRemoteServiceReference reference = registration.getReference();
- getRemoteServiceClientContainerAdapter().getRemoteService(reference);
- assertTrue(getRemoteServiceClientContainerAdapter().ungetRemoteService(reference));
- }
-
- public void testRemoteServiceRegisteredEvent() {
- IRemoteServiceClientContainerAdapter adapter = getRemoteServiceClientContainerAdapter();
- adapter.addRemoteServiceListener(new IRemoteServiceListener() {
- public void handleServiceEvent(IRemoteServiceEvent event) {
- assertTrue(event instanceof IRemoteServiceRegisteredEvent);
- }
- });
- createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
- }
-
- public void testCreateRemoteFilter() {
- String filter = "(" + Constants.OBJECTCLASS + "=" + IRemoteService.class.getName() + ")";
- try {
- IRemoteFilter remoteFilter = getRemoteServiceClientContainerAdapter().createRemoteFilter(filter);
- assertNotNull(remoteFilter);
- } catch (InvalidSyntaxException e) {
- fail();
- }
- }
-
- public void testGetRemoteServiceID() {
- IRemoteServiceRegistration registration = createRpcRegistration(RpcConstants.TEST_ECHO_METHOD);
- long containerRelativeID = registration.getID().getContainerRelativeID();
- IRemoteServiceID remoteServiceID = getRemoteServiceClientContainerAdapter().getRemoteServiceID(container.getID(), containerRelativeID);
- assertEquals(registration.getID(), remoteServiceID);
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceTest.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceTest.java
deleted file mode 100644
index ba66aed1f..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/RpcRemoteServiceTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc;
-
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.ecf.core.IContainer;
-import org.eclipse.ecf.core.util.ECFException;
-import org.eclipse.ecf.internal.tests.remoteservice.rpc.Activator;
-import org.eclipse.ecf.remoteservice.IRemoteCall;
-import org.eclipse.ecf.remoteservice.IRemoteCallListener;
-import org.eclipse.ecf.remoteservice.IRemoteService;
-import org.eclipse.ecf.remoteservice.IRemoteServiceRegistration;
-import org.eclipse.ecf.remoteservice.RemoteCallFactory;
-import org.eclipse.ecf.remoteservice.client.IRemoteCallParameter;
-import org.eclipse.ecf.remoteservice.client.IRemoteCallable;
-import org.eclipse.ecf.remoteservice.client.RemoteCallParameter;
-import org.eclipse.ecf.remoteservice.client.RemoteCallableFactory;
-import org.eclipse.ecf.remoteservice.events.IRemoteCallCompleteEvent;
-import org.eclipse.ecf.remoteservice.events.IRemoteCallEvent;
-import org.eclipse.ecf.tests.remoteservice.rpc.common.IEcho;
-import org.eclipse.equinox.concurrent.future.IFuture;
-
-@SuppressWarnings("restriction")
-public class RpcRemoteServiceTest extends AbstractRpcTestCase {
-
- private static final String ECHO_TEST_DATA = "Hello, world";
-
- IContainer container;
-
- IRemoteServiceRegistration registrationEcho;
-
- IRemoteServiceRegistration registrationEchoProxy;
-
- IRemoteServiceRegistration registrationCalc;
-
- protected void setUp() throws Exception {
- container = createRpcContainer(RpcConstants.TEST_ECHO_TARGET);
-
- IRemoteCallable callableEcho = RemoteCallableFactory.createCallable(RpcConstants.TEST_ECHO_METHOD_NAME, RpcConstants.TEST_ECHO_METHOD,
- new IRemoteCallParameter[]{new RemoteCallParameter(RpcConstants.TEST_ECHO_METHOD_PARAM)});
- registrationEcho = registerCallable(container, callableEcho, null);
-
- IRemoteCallable callableEchoProxy = RemoteCallableFactory.createCallable(IEcho.class.getName());
- registrationEchoProxy = registerCallable(container, callableEchoProxy, null);
-
- IRemoteCallable callableCalc = RemoteCallableFactory.createCallable(RpcConstants.TEST_CALC_PLUS_METHOD_NAME, RpcConstants.TEST_CALC_PLUS_METHOD,
- new IRemoteCallParameter[]{
- new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM1),
- new RemoteCallParameter(RpcConstants.TEST_CALC_PLUS_METHOD_PARAM2)});
- registrationCalc = registerCallable(container, callableCalc, null);
- }
-
- protected void tearDown() throws Exception {
- registrationEcho.unregister();
- registrationEchoProxy.unregister();
- registrationCalc.unregister();
- container.disconnect();
- }
-
- public void testCallViaProxy() {
- IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
- try {
- IEcho echo = (IEcho) rpcClientService.getProxy(Activator.class.getClassLoader(), new Class[]{IEcho.class});
- assertNotNull(echo);
- Object result = echo.echo(ECHO_TEST_DATA);
- assertNotNull(result);
- assertEquals(result, ECHO_TEST_DATA);
- }
- catch (ECFException e) {
- e.printStackTrace();
- fail("Could not contact the service");
- }
- }
-
- public void testCallViaProxy2() {
- IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEchoProxy.getReference());
- try {
- IEcho echo = (IEcho) rpcClientService.getProxy();
- assertNotNull(echo);
- Object result = echo.echo(ECHO_TEST_DATA);
- assertNotNull(result);
- assertEquals(result, ECHO_TEST_DATA);
- }
- catch (ECFException e) {
- e.printStackTrace();
- fail("Could not contact the service");
- }
- }
-
- public void testSyncCall() {
- IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationEcho.getReference());
- try {
- Object result = rpcClientService.callSync(getEchoCall());
- assertNotNull(result);
- assertTrue(ECHO_TEST_DATA.equals(result));
- } catch (ECFException e) {
- fail("Could not contact the service");
- }
- }
-
- public void testAsynCall() {
- IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationCalc.getReference());
- IFuture future = rpcClientService.callAsync(getCalcPlusCall());
- try {
- Object response = future.get();
- assertTrue(response instanceof Integer);
- } catch (OperationCanceledException e) {
- fail(e.getMessage());
- } catch (InterruptedException e) {
- fail(e.getMessage());
- }
- }
-
- public void testAsyncCallWithListener() throws Exception {
- IRemoteService rpcClientService = getRemoteServiceClientContainerAdapter(container).getRemoteService(registrationCalc.getReference());
- rpcClientService.callAsync(getCalcPlusCall(), new IRemoteCallListener() {
- public void handleEvent(IRemoteCallEvent event) {
- if (event instanceof IRemoteCallCompleteEvent) {
- IRemoteCallCompleteEvent cce = (IRemoteCallCompleteEvent) event;
- Object response = cce.getResponse();
- assertTrue(response instanceof Integer);
- syncNotify();
- }
- }
- });
- syncWaitForNotify(10000);
- }
-
- private IRemoteCall getEchoCall() {
- return RemoteCallFactory.createRemoteCall(RpcConstants.TEST_ECHO_METHOD_NAME, new Object[]{ECHO_TEST_DATA});
- }
-
- private IRemoteCall getCalcPlusCall() {
- return RemoteCallFactory.createRemoteCall(RpcConstants.TEST_CALC_PLUS_METHOD_NAME, new Object[]{new Integer(2), new Integer(3)});
- }
-}
diff --git a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/common/IEcho.java b/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/common/IEcho.java
deleted file mode 100644
index f2b8fd319..000000000
--- a/tests/bundles/org.eclipse.ecf.tests.remoteservice.rpc/src/org/eclipse/ecf/tests/remoteservice/rpc/common/IEcho.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010-2011 Naumen. 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:
- * Pavel Samolisov - initial API and implementation
- *******************************************************************************/
-package org.eclipse.ecf.tests.remoteservice.rpc.common;
-
-public interface IEcho {
-
- public String echo(String str);
-}

Back to the top