diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-04 04:57:14 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-03-04 04:57:14 +0000 |
commit | 64dee3e1fd77da265adf4feb83c9928e88c20bb2 (patch) | |
tree | 8de2d9192deaeba30d5a279bcf48b57659093da5 /sca-java-2.x/trunk/modules/sca-client-rmi/src | |
parent | b381d35a885ccb09bfdd77fd8c9806143db20afa (diff) |
Delete obsolete modules
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@918852 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/sca-client-rmi/src')
8 files changed, 0 insertions, 440 deletions
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryFinderImpl.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryFinderImpl.java deleted file mode 100644 index ab87ea27d4..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryFinderImpl.java +++ /dev/null @@ -1,49 +0,0 @@ -/*
- * Copyright(C) OASIS(R) 2005,2009. All Rights Reserved.
- * OASIS trademark, IPR and other policies apply.
- */
-package org.apache.tuscany.sca.client.rmi;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.ServiceRuntimeException;
-import org.oasisopen.sca.client.SCAClientFactory;
-import org.oasisopen.sca.client.SCAClientFactoryFinder;
-
-/**
- * A Tuscany specific implementation of an SCAClientFactoryFinder which finds
- * hard codes the use of the Tuscany SCAClientFactory instead of doscovering it.
- *
- * @see SCAClientFactoryFinder
- * @see SCAClientFactory
- */
-public class SCAClientFactoryFinderImpl implements SCAClientFactoryFinder {
-
- /**
- * Public Constructor
- */
- public SCAClientFactoryFinderImpl() {
- }
-
- /**
- * Creates an instance of the SCAClientFactorySPI implementation.
- * This discovers the SCAClientFactorySPI Implementation and instantiates
- * the provider's implementation.
- *
- * @param properties Properties that may be used when creating a new
- * instance of the SCAClient
- * @param classLoader ClassLoader that may be used when creating a new
- * instance of the SCAClient
- * @return new instance of the SCAClientFactory
- * @throws ServiceRuntimeException Failed to create SCAClientFactory
- * Implementation.
- */
- public SCAClientFactory find(Properties properties,
- ClassLoader classLoader,
- URI domainURI ) throws NoSuchDomainException, ServiceRuntimeException {
- return new SCAClientFactoryImpl(domainURI);
- }
-
-}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java deleted file mode 100644 index 3ffe7df629..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientFactoryImpl.java +++ /dev/null @@ -1,122 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.client.rmi;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.net.URI;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
-import org.apache.tuscany.sca.node.impl.NodeImpl;
-import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
-import org.apache.tuscany.sca.runtime.EndpointRegistry;
-import org.apache.tuscany.sca.runtime.ExtensibleDomainRegistryFactory;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-import org.oasisopen.sca.client.SCAClientFactoryFinder;
-
-public class SCAClientFactoryImpl extends SCAClientFactory {
-
- public static void setSCAClientFactoryFinder(SCAClientFactoryFinder factoryFinder) {
- SCAClientFactory.factoryFinder = factoryFinder;
- }
-
- private ExtensionPointRegistry extensionsRegistry;
- private EndpointRegistry endpointRegistry;
- private NodeFactoryImpl nodeFactory;
-
- public SCAClientFactoryImpl(URI domainURI) throws NoSuchDomainException {
- super(domainURI);
-
- this.nodeFactory = (NodeFactoryImpl)NodeFactory.getInstance();
- this.nodeFactory.init();
- this.extensionsRegistry = nodeFactory.getExtensionPoints();
- if (extensionsRegistry != null) {
- this.extensionsRegistry = nodeFactory.getExtensionPoints();
- DomainRegistryFactory domainRegistryFactory = ExtensibleDomainRegistryFactory.getInstance(extensionsRegistry);
- this.endpointRegistry = domainRegistryFactory.getEndpointRegistry(getRegistryURI(), getDomainName());
- }
- }
-
- private String getRegistryURI() {
- String uri = getDomainURI().toString();
- if (uri.startsWith("tuscany:")) {
- uri = uri.replace("tuscany:", "tuscanyclient:");
- }
- return uri;
- }
-
- private String getDomainName() {
- if (getDomainURI().getHost() != null) {
- return getDomainURI().getHost();
- }
- String uri = getDomainURI().toString();
- if (!uri.startsWith("tuscany://")) {
- if (uri.startsWith("tuscany:")) {
- uri = uri.replace("tuscany:", "tuscany://");
- return URI.create(uri).getHost();
- }
- }
- return uri;
- }
-
- @Override
- public <T> T getService(Class<T> serviceInterface, String serviceName) throws NoSuchServiceException, NoSuchDomainException {
-
- if (endpointRegistry != null) {
- List<Endpoint> eps = endpointRegistry.findEndpoint(serviceName);
- if (eps == null || eps.size() < 1) {
- throw new NoSuchServiceException(serviceName);
- }
- Endpoint endpoint = eps.get(0); // TODO: what should be done with multiple endpoints?
-
- Node localNode = findLocalNode(endpoint);
- if (localNode != null) {
- return localNode.getService(serviceInterface, serviceName);
- }
- }
-
- String uri = getDomainURI().toString();
- if (uri.startsWith("tuscany:")) {
- uri = uri.replace("tuscany:", "tuscanyclient://");
- }
- InvocationHandler handler = new SCAClientProxyHandler(nodeFactory, uri, getDomainName(), serviceName);
- return (T)Proxy.newProxyInstance(serviceInterface.getClassLoader(), new Class[] {serviceInterface}, handler);
-
- }
-
- private Node findLocalNode(Endpoint endpoint) {
- for (Node node : nodeFactory.getNodes().values()) {
- for (Endpoint ep : ((NodeImpl)node).getServiceEndpoints()) {
- if (endpoint.getURI().equals(ep.getURI())) {
- return node;
- }
- }
- }
- return null;
- }
-
-}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientModuleActivator.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientModuleActivator.java deleted file mode 100644 index af9ac1d9c5..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientModuleActivator.java +++ /dev/null @@ -1,37 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.client.rmi;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.ModuleActivator;
-
-public class SCAClientModuleActivator implements ModuleActivator {
-
- public SCAClientModuleActivator(ExtensionPointRegistry registry) {
- }
-
- public void start() {
- SCAClientFactoryImpl.setSCAClientFactoryFinder(new SCAClientFactoryFinderImpl());
- }
-
- public void stop() {
-
- }
-}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientProxyHandler.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientProxyHandler.java deleted file mode 100644 index c8c60edd53..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/java/org/apache/tuscany/sca/client/rmi/SCAClientProxyHandler.java +++ /dev/null @@ -1,105 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.client.rmi;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.util.List;
-
-import org.apache.tuscany.sca.assembly.AssemblyFactory;
-import org.apache.tuscany.sca.assembly.Endpoint;
-import org.apache.tuscany.sca.assembly.EndpointReference;
-import org.apache.tuscany.sca.binding.rmi.provider.RMIBindingInvoker;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.FactoryExtensionPoint;
-import org.apache.tuscany.sca.host.rmi.ExtensibleRMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHost;
-import org.apache.tuscany.sca.host.rmi.RMIHostExtensionPoint;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.apache.tuscany.sca.node.impl.NodeFactoryImpl;
-import org.apache.tuscany.sca.runtime.DomainRegistryFactory;
-import org.apache.tuscany.sca.runtime.DomainRegistryFactoryExtensionPoint;
-import org.apache.tuscany.sca.runtime.EndpointRegistry;
-import org.oasisopen.sca.NoSuchServiceException;
-
-public class SCAClientProxyHandler implements InvocationHandler {
-
- protected NodeFactoryImpl nodeFactory;
- protected ExtensionPointRegistry extensionsRegistry;
- protected EndpointRegistry endpointRegistry;
- protected EndpointReference endpointReference;
- protected String registryURI;
- protected String domainURI;
- protected String serviceName;
- protected RMIHost rmiHost;
-
- public SCAClientProxyHandler(NodeFactoryImpl nodeFactory, String registryURI, String domainURI, String serviceName) {
- this.nodeFactory = nodeFactory;
- this.registryURI = registryURI;
- this.domainURI = domainURI;
- this.serviceName = serviceName;
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- Node node = null;
- try {
-
- nodeFactory = (NodeFactoryImpl)NodeFactory.newInstance();
- node = nodeFactory.createNode(URI.create(registryURI)).start();
- this.extensionsRegistry = nodeFactory.getExtensionPoints();
- RMIHostExtensionPoint rmiHosts = extensionsRegistry.getExtensionPoint(RMIHostExtensionPoint.class);
- this.rmiHost = new ExtensibleRMIHost(rmiHosts);
-
- FactoryExtensionPoint factories = extensionsRegistry.getExtensionPoint(FactoryExtensionPoint.class);
- AssemblyFactory assemblyFactory = factories.getFactory(AssemblyFactory.class);
-
- this.endpointReference = assemblyFactory.createEndpointReference();
- endpointReference.setReference(assemblyFactory.createComponentReference());
- Endpoint targetEndpoint = assemblyFactory.createEndpoint();
- targetEndpoint.setURI(serviceName);
- endpointReference.setTargetEndpoint(targetEndpoint);
- DomainRegistryFactoryExtensionPoint factoriesx = extensionsRegistry.getExtensionPoint(DomainRegistryFactoryExtensionPoint.class);
- for (DomainRegistryFactory factory : factoriesx.getDomainRegistryFactories()) {
- for (EndpointRegistry endpointRegistry : factory.getEndpointRegistries()) {
- if (endpointRegistry.getDomainURI().equals(domainURI)) {
- this.endpointRegistry = endpointRegistry;
- }
- }
- }
-
- List<Endpoint> endpoints = endpointRegistry.findEndpoint(endpointReference);
- if (endpoints.size() <1 ) {
- throw new NoSuchServiceException(serviceName);
- }
-
- String uri = endpoints.get(0).getBinding().getURI();
- RMIBindingInvoker invoker = new RMIBindingInvoker(rmiHost, uri, method);
-
- return invoker.invokeTarget(args);
-
- } finally {
- if (node != null) {
- node.stop();
- }
- }
- }
-}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator deleted file mode 100644 index 8ae7671239..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.apache.tuscany.sca.core.ModuleActivator +++ /dev/null @@ -1,18 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -# Implementation class for the ModuleActivator -org.apache.tuscany.sca.client.rmi.SCAClientModuleActivator;ranking=200 diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory b/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory deleted file mode 100644 index 8be1f22af4..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/main/resources/META-INF/services/org.oasisopen.sca.client.SCAClientFactory +++ /dev/null @@ -1,19 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-# Implementation class for the ModuleActivator
-org.apache.tuscany.sca.client.rmi.SCAClientFactoryImpl
-
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/calculator/CalculatorService.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/calculator/CalculatorService.java deleted file mode 100644 index 12d80ffd1c..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/calculator/CalculatorService.java +++ /dev/null @@ -1,38 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package calculator;
-
-import org.oasisopen.sca.annotation.Remotable;
-
-
-/**
- * The Calculator service interface.
- */
-@Remotable
-public interface CalculatorService {
-
- double add(double n1, double n2);
-
- double subtract(double n1, double n2);
-
- double multiply(double n1, double n2);
-
- double divide(double n1, double n2);
-
-}
diff --git a/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/org/apache/tuscany/sca/client/rmi/ClientTestCase.java b/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/org/apache/tuscany/sca/client/rmi/ClientTestCase.java deleted file mode 100644 index cbfab52b6f..0000000000 --- a/sca-java-2.x/trunk/modules/sca-client-rmi/src/test/java/org/apache/tuscany/sca/client/rmi/ClientTestCase.java +++ /dev/null @@ -1,52 +0,0 @@ -/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tuscany.sca.client.rmi;
-
-import static org.junit.Assert.assertEquals;
-
-import java.net.URI;
-
-import org.apache.tuscany.sca.binding.rmi.RMIBinding;
-import org.apache.tuscany.sca.node.Node;
-import org.apache.tuscany.sca.node.NodeFactory;
-import org.junit.Ignore;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-import calculator.CalculatorService;
-
-@Ignore
-public class ClientTestCase {
-
- //@Test
- public void foo() throws NoSuchServiceException, NoSuchDomainException {
-
- System.setProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding", RMIBinding.TYPE.toString());
- Node node = NodeFactory.newInstance().createNode(URI.create("tuscany:foo?listen=127.0.0.1:14828"), new String[]{"../../samples/calculator/target/sample-calculator.jar"});
- node.start();
-
- SCAClientFactoryImpl cf = new SCAClientFactoryImpl(URI.create("tuscanyclient:foo?remotes=127.0.0.1:14828"));
- CalculatorService service = cf.getService(CalculatorService.class, "CalculatorServiceComponent");
- assertEquals(3, service.add(1, 2), 0);
-
- node.stop();
- System.clearProperty("org.apache.tuscany.sca.binding.sca.provider.SCABindingMapper.mappedBinding");
- }
-}
|