You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by sl...@apache.org on 2007/09/14 13:07:07 UTC
svn commit: r575620 [3/4] - in /incubator/tuscany/java/sca:
distribution/webapp/
distribution/webapp/src/main/java/org/apache/tuscany/sca/webapp/
distribution/webapp/src/main/resources/_node/ itest/callablereferences/
itest/callablereferences/src/main/...
Added: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,562 @@
+/*
+ * 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.node.impl;
+
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.ServerSocket;
+import java.net.URL;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.xml.namespace.QName;
+
+import org.apache.tuscany.sca.assembly.AssemblyFactory;
+import org.apache.tuscany.sca.assembly.Binding;
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.assembly.ComponentService;
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.assembly.CompositeService;
+import org.apache.tuscany.sca.assembly.SCABinding;
+import org.apache.tuscany.sca.assembly.SCABindingFactory;
+import org.apache.tuscany.sca.assembly.xml.Constants;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint;
+import org.apache.tuscany.sca.contribution.resolver.impl.ModelResolverImpl;
+import org.apache.tuscany.sca.contribution.service.ContributionService;
+import org.apache.tuscany.sca.core.assembly.ActivationException;
+import org.apache.tuscany.sca.core.context.ServiceReferenceImpl;
+import org.apache.tuscany.sca.node.ComponentManager;
+import org.apache.tuscany.sca.node.ContributionManager;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeManagerInitService;
+import org.apache.tuscany.sca.domain.Domain;
+import org.apache.tuscany.sca.domain.DomainManagerService;
+import org.apache.tuscany.sca.domain.ServiceDiscoveryService;
+import org.apache.tuscany.sca.host.embedded.impl.EmbeddedSCADomain;
+import org.apache.tuscany.sca.host.embedded.impl.ReallySmallRuntime;
+import org.apache.tuscany.sca.interfacedef.InterfaceContract;
+import org.apache.tuscany.sca.interfacedef.java.JavaInterfaceFactory;
+import org.apache.tuscany.sca.runtime.RuntimeComponent;
+import org.apache.tuscany.sca.runtime.RuntimeComponentContext;
+import org.apache.tuscany.sca.runtime.RuntimeComponentReference;
+import org.osoa.sca.CallableReference;
+import org.osoa.sca.ServiceReference;
+import org.osoa.sca.ServiceRuntimeException;
+
+/**
+ * A local representation of the sca domain running on a single node
+ *
+ * @version $Rev: 552343 $ $Date: 2007-09-09 23:54:46 +0100 (Sun, 09 Sep 2007) $
+ */
+public class NodeImpl implements Domain, Node {
+
+ private final static Logger logger = Logger.getLogger(NodeImpl.class.getName());
+
+ public final static String LOCAL_DOMAIN_URI = "localdomain";
+ public final static String LOCAL_NODE_URI = "localnode";
+
+ private boolean isStandalone = false;
+
+ // the domain used by the node to talk to the rest of the domain
+ private EmbeddedSCADomain managementRuntime;
+
+ // class loader used to get the runtime going
+ private ClassLoader domainClassLoader;
+
+ // representation of the private state of the node that the domain is running on
+ private String domainUri;
+ private String nodeUri;
+ private ReallySmallRuntime nodeRuntime;
+ private Composite nodeComposite;
+
+ // the managers used to control the domain node
+ private ComponentManagerServiceImpl componentManager;
+ // private CompositeManagerImpl compositeManager;
+ private ContributionManagerImpl contributionManager;
+
+ // the proxies to the domain
+ private ServiceDiscoveryService serviceDiscovery;
+ private DomainManagerService domainManager;
+ private NodeManagerInitService nodeManagerInit;
+
+ // methods defined on the implementation only
+
+ /**
+ * Default constructor creates a standalone node with no connectivity to a wider
+ * domain and no local web page.
+ */
+ public NodeImpl()
+ throws ActivationException {
+ this.domainUri = LOCAL_DOMAIN_URI ;
+ this.nodeUri = LOCAL_NODE_URI;
+ this.isStandalone = true;
+ init();
+ }
+
+ /**
+ * Creates a node connected to a wider domain. To find its place in the domain
+ * node and domain identifiers must be provided.
+ *
+ * @param domainUri the domain identifier
+ * @param nodeUri the node identifier
+ * @throws ActivationException
+ */
+ public NodeImpl(String domainUri, String nodeUri)
+ throws ActivationException {
+ this.domainUri = domainUri;
+ this.nodeUri = nodeUri;
+ this.isStandalone = false;
+ init();
+ }
+
+ /**
+ * Creates a node connected to a wider domain and allows a classpath to be specified.
+ * To find its place in the domain node and domain identifiers must be provided.
+ *
+ * @param domainUri the domain identifier
+ * @param nodeUri the node identifier
+ * @param classpath the classpath to use for loading system resources for the node
+ * @throws ActivationException
+ */
+ public NodeImpl(String domainUri, String nodeUri, ClassLoader cl)
+ throws ActivationException {
+ this.domainUri = domainUri;
+ this.nodeUri = nodeUri;
+ this.domainClassLoader = cl;
+ this.isStandalone = LOCAL_DOMAIN_URI.equals(domainUri);
+ init();
+ }
+
+ /**
+ * Work out if we are representing a domain in memory or can go out to the network to
+ * get domain information. This all depends on whether there is a management
+ * composite on the classpath
+ */
+ private void init()
+ throws ActivationException {
+ try {
+ if (domainClassLoader == null) {
+ domainClassLoader = NodeImpl.class.getClassLoader();
+ }
+
+ // create a node runtime for the domain contributions to run on
+ nodeRuntime = new ReallySmallRuntime(domainClassLoader);
+
+ // Check if node has been given a domain name to connect to
+ if (isStandalone) {
+ logger.log(Level.INFO, "Domain node will be started stand-alone as node and domain name are not provided");
+ managementRuntime = null;
+ serviceDiscovery = null;
+ } else {
+ createManagementNode();
+ }
+ } catch(ActivationException ex) {
+ throw ex;
+ } catch(Exception ex) {
+ throw new ActivationException(ex);
+ }
+ }
+
+ private void createManagementNode()
+ throws ActivationException {
+ try {
+ // create a runtime for components to run on that will be used for talking to the
+ // rest of the domain
+ String contributionString = "_node/";
+ URL contributionURL = domainClassLoader.getResource(contributionString);
+
+ if ( contributionURL != null ){
+ logger.log(Level.INFO,
+ "Domain node will use node management contribution from " +
+ contributionURL);
+
+
+ // start a local domain in order to talk to the logical domain
+ managementRuntime = new EmbeddedSCADomain(domainClassLoader, "node");
+ managementRuntime.start();
+
+ // add node composite to the management domain
+ ContributionService contributionService = managementRuntime.getContributionService();
+
+ Contribution contribution = contributionService.contribute(nodeUri,
+ contributionURL,
+ false);
+ if (contribution.getDeployables().size() != 0) {
+ Composite composite = contribution.getDeployables().get(0);
+
+ managementRuntime.getDomainComposite().getIncludes().add(composite);
+ managementRuntime.getCompositeBuilder().build(composite);
+
+ // deal with the special case of registering the node manager service
+ // in service discovery. It's not on an SCA binding.
+ // TODO - really want to be able to hand out service references but they
+ // don't serialize out over web services yet.
+ fixUpManagementServiceUrls();
+
+ managementRuntime.getCompositeActivator().activate(composite);
+ managementRuntime.getCompositeActivator().start(composite);
+
+ // get the management components out of the domain so that they
+ // can be configured/used. None are yet but this would be the place to
+ // get components out of the management domain and give them access to
+ // useful parts of the node
+ serviceDiscovery = managementRuntime.getService(ServiceDiscoveryService.class, "ServiceDiscoveryComponent");
+ domainManager = managementRuntime.getService(DomainManagerService.class, "DomainManagerComponent");
+ nodeManagerInit = managementRuntime.getService(NodeManagerInitService.class, "NodeManagerComponent/NodeManagerInitService");
+
+ // Now get the uri back out of the component no it has been build and started
+ // TODO - this doesn't pick up the url from external hosting environments
+ String nodeManagerUrl = getNodeManagerServiceUrl();
+
+ if (nodeManagerUrl != null) {
+ if (isStandalone == false){
+ try {
+
+ serviceDiscovery.registerServiceEndpoint(domainUri,
+ nodeUri,
+ nodeUri + "NodeManagerService",
+ "",
+ nodeManagerUrl);
+
+ } catch(Exception ex) {
+ // not sure what to do here
+ logger.log(Level.WARNING, "Can't connect to domain manager");
+ }
+ }
+ }
+
+ } else {
+ throw new ActivationException("Node management contribution " +
+ contributionURL +
+ " found but could not be loaded");
+ }
+ } else {
+ throw new ActivationException("Node contribution " +
+ contributionString +
+ " not found on the classpath");
+ }
+ } catch(ActivationException ex) {
+ throw ex;
+ } catch(Exception ex) {
+ throw new ActivationException(ex);
+ }
+ }
+
+ /**
+ * A rather ugly method to find out to fix the url of the service, assuming that there
+ * is one.
+ *
+ * we can't get is out of a service reference
+ * the component itself doesn't know how to get it
+ * the binding can't to do it automatically as it's not he sca binding
+ *
+ * TODO - This would be better done by passing out a serializable reference to service discovery
+ * but this doesn't work yet
+ *
+ * @return node manager url
+ */
+ private void fixUpManagementServiceUrls(){
+ String nodeManagerUrl = null;
+
+ // First get the NodeManager binding from the model
+ List<Component> components = managementRuntime.getDomainComposite().getIncludes().get(0).getComponents();
+
+ for(Component component : components){
+ for (ComponentService service : component.getServices() ){
+ for (Binding binding : service.getBindings() ) {
+ fixUpBindingUrl(binding);
+ }
+ }
+ }
+ }
+
+ private String getNodeManagerServiceUrl(){
+ String nodeManagerUrl = null;
+
+ // First get the NodeManager binding from the model
+ List<Component> components = managementRuntime.getDomainComposite().getIncludes().get(0).getComponents();
+
+ for(Component component : components){
+ for (ComponentService service : component.getServices() ){
+
+ if ( service.getName().equals("NodeManagerService")) {
+ nodeManagerUrl = service.getBindings().get(0).getURI();
+ }
+ }
+ }
+
+ return nodeManagerUrl;
+ }
+
+ /**
+ * For http protocol find a port that isn't in use and make sure the domain name is the real domain name
+ *
+ * @param binding
+ */
+ private void fixUpBindingUrl(Binding binding){
+
+ String urlString = binding.getURI();
+
+ try {
+
+ if( (urlString.startsWith("http") != true ) ||
+ (binding instanceof SCABinding)) {
+ return;
+ }
+
+ URL url = new URL(urlString);
+ String protocol = url.getProtocol();
+
+ // first find a socket that is available starting with what
+ // is in the composite file
+ int port = url.getPort();
+ int startPort = port;
+ boolean portIsBusy = true;
+
+ do {
+ try {
+ ServerSocket socket = new ServerSocket(port);
+ portIsBusy = false;
+ socket.close();
+ break;
+ }
+ catch (IOException ex) {
+ // the port is busy
+ port = port + 1;
+ }
+ } while (portIsBusy || port > 9999);
+
+ urlString = urlString.replace(String.valueOf(startPort), String.valueOf(port));
+
+ // now replace localhost, if its there, with the real host name
+ InetAddress address = InetAddress.getLocalHost();
+ urlString = urlString.replace("localhost", address.getHostName());
+
+ // set the address back into the NodeManager binding.
+ binding.setURI(urlString);
+
+ } catch (Exception ex) {
+ // don't do anything and leave the address as is
+ logger.log(Level.WARNING,
+ "Exception while fixing up binding url in management composite " +
+ urlString,
+ ex);
+ }
+ }
+
+
+ // methods that implement interfaces
+
+ public void start() throws ActivationException {
+ // Start the runtime
+ nodeRuntime.start();
+
+ // Create an in-memory domain level composite
+ AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
+ nodeComposite = assemblyFactory.createComposite();
+ nodeComposite.setName(new QName(Constants.SCA10_NS, "domain"));
+ nodeComposite.setURI(domainUri);
+
+ // add the top level composite into the composite activator
+ nodeRuntime.getCompositeActivator().setDomainComposite(nodeComposite);
+
+ // make the domain available to the model.
+ // TODO - No sure how this should be done properly. As a nod to this though
+ // I have a domain factory which always returns the same domain
+ // object. I.e. this node
+ ModelFactoryExtensionPoint factories = nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
+ DomainFactoryImpl domainFactory = new DomainFactoryImpl(this);
+ factories.addFactory(domainFactory);
+
+ // create the domain node managers
+ componentManager = new ComponentManagerServiceImpl(domainUri, nodeUri, nodeComposite, nodeRuntime);
+ contributionManager = new ContributionManagerImpl(domainUri, nodeUri, nodeComposite, nodeRuntime, domainClassLoader, null);
+
+ if (isStandalone == false){
+ // pass this object into the node manager
+ nodeManagerInit.setNode((Node)this);
+
+ try {
+ // go out and add this node to the wider domain
+ domainManager.registerNode(domainUri, nodeUri);
+ } catch(Exception ex) {
+ // not sure what to do here
+ logger.log(Level.WARNING, "Can't connect to domain manager");
+ }
+ }
+ }
+
+ public void stop() throws ActivationException {
+ // Stop the node
+ nodeRuntime.stop();
+
+ // Cleanup the top level composite
+ nodeComposite = null;
+
+ // remove the manager objects
+
+ // go out and remove this node from the wider domain
+ if (isStandalone == false){
+ try {
+ domainManager.removeNode(domainUri, nodeUri);
+ } catch(Exception ex) {
+ // not sure what to do here
+ logger.log(Level.WARNING, "Can't connect to domain manager");
+ }
+ }
+ }
+
+ public String getDomainUri(){
+ return domainUri;
+ }
+
+ public String getNodeUri(){
+ return nodeUri;
+ }
+
+ public ComponentManager getComponentManager() {
+ return componentManager;
+ }
+
+/*
+ public CompositeManager getCompositeManager() {
+ return compositeManager;
+ }
+*/
+
+ public ContributionManager getContributionManager() {
+ return contributionManager;
+ }
+
+ public ContributionManager getContributionManager(ClassLoader classLoader) {
+
+ return new ContributionManagerImpl(domainUri, nodeUri, nodeComposite, nodeRuntime, classLoader, new ModelResolverImpl(classLoader));
+ }
+
+
+ /**
+ * Return an interface for registering local services and for
+ * finding remote services
+ *
+ * @return The service discovery interface
+ */
+ public ServiceDiscoveryService getServiceDiscovery(){
+ return serviceDiscovery;
+ }
+
+ public <B, R extends CallableReference<B>> R cast(B target) throws IllegalArgumentException {
+ return (R)nodeRuntime.getProxyFactory().cast(target);
+ }
+
+ public <B> B getService(Class<B> businessInterface, String serviceName) {
+ ServiceReference<B> serviceReference = getServiceReference(businessInterface, serviceName);
+ if (serviceReference == null) {
+ throw new ServiceRuntimeException("Service not found: " + serviceName);
+ }
+ return serviceReference.getService();
+ }
+
+ private <B> ServiceReference<B> createServiceReference(Class<B> businessInterface, String targetURI) {
+ try {
+ AssemblyFactory assemblyFactory = nodeRuntime.getAssemblyFactory();
+ Composite composite = assemblyFactory.createComposite();
+ composite.setName(new QName(Constants.SCA10_TUSCANY_NS, "default"));
+ RuntimeComponent component = (RuntimeComponent)assemblyFactory.createComponent();
+ component.setName("default");
+ component.setURI("default");
+ nodeRuntime.getCompositeActivator().configureComponentContext(component);
+ composite.getComponents().add(component);
+ RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference();
+ reference.setName("default");
+ ModelFactoryExtensionPoint factories =
+ nodeRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class);
+ JavaInterfaceFactory javaInterfaceFactory = factories.getFactory(JavaInterfaceFactory.class);
+ InterfaceContract interfaceContract = javaInterfaceFactory.createJavaInterfaceContract();
+ interfaceContract.setInterface(javaInterfaceFactory.createJavaInterface(businessInterface));
+ reference.setInterfaceContract(interfaceContract);
+ component.getReferences().add(reference);
+ reference.setComponent(component);
+ SCABindingFactory scaBindingFactory = factories.getFactory(SCABindingFactory.class);
+ SCABinding binding = scaBindingFactory.createSCABinding();
+ binding.setURI(targetURI);
+ reference.getBindings().add(binding);
+ return new ServiceReferenceImpl<B>(businessInterface, component, reference, binding, nodeRuntime
+ .getProxyFactory(), nodeRuntime.getCompositeActivator());
+ } catch (Exception e) {
+ throw new ServiceRuntimeException(e);
+ }
+ }
+
+ public <B> ServiceReference<B> getServiceReference(Class<B> businessInterface, String name) {
+
+ // Extract the component name
+ String componentName;
+ String serviceName;
+ int i = name.indexOf('/');
+ if (i != -1) {
+ componentName = name.substring(0, i);
+ serviceName = name.substring(i + 1);
+
+ } else {
+ componentName = name;
+ serviceName = null;
+ }
+
+ // Lookup the component in the domain
+ Component component = componentManager.getComponent(componentName);
+ if (component == null) {
+ // The component is not local in the partition, try to create a remote service ref
+ return createServiceReference(businessInterface, name);
+ }
+ RuntimeComponentContext componentContext = null;
+
+ // If the component is a composite, then we need to find the
+ // non-composite component that provides the requested service
+ if (component.getImplementation() instanceof Composite) {
+ for (ComponentService componentService : component.getServices()) {
+ if (serviceName == null || serviceName.equals(componentService.getName())) {
+ CompositeService compositeService = (CompositeService)componentService.getService();
+ if (compositeService != null) {
+ if (serviceName != null) {
+ serviceName = "$promoted$." + serviceName;
+ }
+ componentContext =
+ ((RuntimeComponent)compositeService.getPromotedComponent()).getComponentContext();
+ return componentContext.createSelfReference(businessInterface, compositeService
+ .getPromotedService());
+ }
+ break;
+ }
+ }
+ // No matching service is found
+ throw new ServiceRuntimeException("Composite service not found: " + name);
+ } else {
+ componentContext = ((RuntimeComponent)component).getComponentContext();
+ if (serviceName != null) {
+ return componentContext.createSelfReference(businessInterface, serviceName);
+ } else {
+ return componentContext.createSelfReference(businessInterface);
+ }
+ }
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeManagerServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeManagerServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeManagerServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/NodeManagerServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.node.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.tuscany.sca.assembly.Component;
+import org.apache.tuscany.sca.core.assembly.ActivationException;
+import org.apache.tuscany.sca.node.ComponentInfo;
+import org.apache.tuscany.sca.node.ComponentManagerService;
+import org.apache.tuscany.sca.node.Node;
+import org.apache.tuscany.sca.node.NodeManagerInitService;
+import org.apache.tuscany.sca.node.NodeManagerService;
+import org.osoa.sca.annotations.Scope;
+import org.osoa.sca.annotations.Service;
+
+/**
+ * Stores details of services exposed and retrieves details of remote services
+ *
+ * @version $Rev: 552343 $ $Date: 2007-09-11 18:45:36 +0100 (Tue, 11 Sep 2007) $
+ */
+@Scope("COMPOSITE")
+@Service(interfaces = {NodeManagerService.class, NodeManagerInitService.class, ComponentManagerService.class})
+public class NodeManagerServiceImpl implements NodeManagerService, NodeManagerInitService, ComponentManagerService {
+
+ private Node node;
+
+ public String getNodeUri() {
+ return node.getNodeUri();
+ }
+
+ // NodeManagerInitService
+ public void setNode(Node node) {
+ this.node = node;
+ }
+
+ // ComponentManagerService
+ public List<ComponentInfo> getComponentInfos() {
+ List<ComponentInfo> componentInfos = new ArrayList<ComponentInfo>();
+ for (Component component : node.getComponentManager().getComponents()) {
+ ComponentInfo componentInfo = new ComponentInfoImpl();
+ componentInfo.setName(component.getName());
+ componentInfo.setStarted(node.getComponentManager().isComponentStarted(component));
+ componentInfos.add(componentInfo);
+ }
+ return componentInfos;
+ }
+
+ public ComponentInfo getComponentInfo(String componentName) {
+ Component component = node.getComponentManager().getComponent(componentName);
+ ComponentInfo componentInfo = new ComponentInfoImpl();
+ componentInfo.setName(component.getName());
+ componentInfo.setStarted(node.getComponentManager().isComponentStarted(component));
+ return componentInfo;
+ }
+
+ public void startComponent(String componentName) throws ActivationException {
+ node.getComponentManager().startComponent(node.getComponentManager().getComponent(componentName));
+ }
+
+ public void stopComponent(String componentName) throws ActivationException {
+ node.getComponentManager().stopComponent(node.getComponentManager().getComponent(componentName));
+ }
+
+ // TODO - ContributionManagerService
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/ServiceDiscoveryProxyImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/ServiceDiscoveryProxyImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/ServiceDiscoveryProxyImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/main/java/org/apache/tuscany/sca/node/impl/ServiceDiscoveryProxyImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,113 @@
+/*
+ * 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.node.impl;
+
+import org.apache.tuscany.sca.domain.ServiceDiscoveryService;
+import org.apache.tuscany.sca.domain.ServiceInfo;
+import org.osoa.sca.annotations.Reference;
+
+
+/**
+ * Stores details of services exposed and retrieves details of remote services
+ *
+ * @version $Rev: 552343 $ $Date: 2007-09-09 23:54:46 +0100 (Sun, 09 Sep 2007) $
+ */
+public class ServiceDiscoveryProxyImpl implements ServiceDiscoveryService{
+
+ @Reference
+ protected ServiceDiscoveryService serviceDiscovery;
+
+ /**
+ * Accepts information about a service endpoint and holds onto it
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param nodeUri the string uri for the current node
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that is providing the endpoint
+ * @param url the enpoint url
+ * @return dummy valus just so that we don;t have a void return which doesn't work
+ */
+ public String registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){
+ /*
+ System.err.println("Registering service: [" +
+ domainUri + " " +
+ nodeUri + " " +
+ serviceName + " " +
+ bindingName + " " +
+ URL +
+ "]");
+ */
+
+ String dummy = null;
+
+ // try {
+ dummy = serviceDiscovery.registerServiceEndpoint(domainUri, nodeUri, serviceName, bindingName, URL);
+ // } catch(Exception ex) {
+ // When we get round to caching we could keep a list of registered endpoints
+ // and try again later either when this object is called or when the
+ // domain comes back up again
+ /* not sure this should be an exception
+ throw new IllegalStateException("Unable to registering service: " +
+ domainUri + " " +
+ nodeUri + " " +
+ serviceName + " " +
+ bindingName + " " +
+ URL, ex );
+ */
+ // }
+
+ return dummy;
+ }
+
+
+ /**
+ * Locates information about a service endpoint
+ *
+ * @param domainUri the string uri for the distributed domain
+ * @param serviceName the name of the service that is exposed and the provided endpoint
+ * @param bindingName the remote binding that we want to find an endpoint for
+ * @return url the endpoint url
+ */
+ public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){
+ /*
+ System.err.println("Finding service: [" +
+ domainUri + " " +
+ serviceName + " " +
+ bindingName +
+ "]");
+ */
+
+ String url = null;
+
+ try {
+ url = serviceDiscovery.findServiceEndpoint(domainUri, serviceName, bindingName);
+ } catch(Exception ex) {
+ // do nothing here.
+ // If we can't find a service fo what ever reason then just return null
+ }
+
+ return url;
+ }
+
+ public ServiceInfo getServiceInfo(){
+ return serviceDiscovery.getServiceInfo();
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddService.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddService.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddService.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.osoa.sca.annotations.Remotable;
+
+/**
+ * The Add service interface
+ */
+@Remotable
+public interface AddService {
+
+ double add(double n1, double n2);
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/AddServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * An implementation of the Add service
+ */
+public class AddServiceImpl implements AddService {
+
+ public double add(double n1, double n2) {
+ System.out.println("AddService - add " + n1 + " and " + n2);
+ return n1 + n2;
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorService.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorService.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorService.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,35 @@
+/*
+ * 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;
+
+
+/**
+ * The Calculator service interface.
+ */
+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);
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/CalculatorServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,74 @@
+/*
+ * 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.osoa.sca.annotations.Reference;
+
+
+/**
+ * An implementation of the Calculator service.
+ */
+public class CalculatorServiceImpl implements CalculatorService {
+
+ private AddService addService;
+ private SubtractService subtractService;
+ private MultiplyService multiplyService;
+ private DivideService divideService;
+
+ @Reference
+ public void setAddService(AddService addService) {
+ this.addService = addService;
+ }
+
+ @Reference
+ public void setSubtractService(SubtractService subtractService) {
+ this.subtractService = subtractService;
+ }
+
+ @Reference
+ public void setMultiplyService(MultiplyService multiplyService) {
+ this.multiplyService = multiplyService;
+ }
+
+ @Reference
+ public void setDivideService(DivideService divideService) {
+ this.divideService = divideService;
+ }
+
+ public double add(double n1, double n2) {
+ System.out.println("CalculatorService - add " + n1 + " and " + n2);
+ return addService.add(n1, n2);
+ }
+
+ public double subtract(double n1, double n2) {
+ System.out.println("CalculatorService - subtract " + n1 + " and " + n2);
+ return subtractService.subtract(n1, n2);
+ }
+
+ public double multiply(double n1, double n2) {
+ System.out.println("CalculatorService - multiply " + n1 + " and " + n2);
+ return multiplyService.multiply(n1, n2);
+ }
+
+ public double divide(double n1, double n2) {
+ System.out.println("CalculatorService - divide " + n1 + " and " + n2);
+ return divideService.divide(n1, n2);
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideService.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideService.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideService.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+/**
+ * The divide service interface
+ */
+public interface DivideService {
+
+ double divide(double n1, double n2);
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/DivideServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * An implementation of the Divide service.
+ */
+public class DivideServiceImpl implements DivideService {
+
+ public double divide(double n1, double n2) {
+ return n1 / n2;
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyService.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyService.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyService.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,28 @@
+/*
+ * 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;
+
+/**
+ * The interface for the multiply service
+ */
+public interface MultiplyService {
+
+ double multiply(double n1, double n2);
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/MultiplyServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * An implementation of the Multiply service.
+ */
+public class MultiplyServiceImpl implements MultiplyService {
+
+ public double multiply(double n1, double n2) {
+ return n1 * n2;
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractService.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractService.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractService.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,31 @@
+/*
+ * 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.osoa.sca.annotations.Remotable;
+
+/**
+ * The interface for the multiply service
+ */
+@Remotable
+public interface SubtractService {
+
+ double subtract(double n1, double n2);
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractServiceImpl.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractServiceImpl.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/calculator/SubtractServiceImpl.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * An implementation of the subtract service.
+ */
+public class SubtractServiceImpl implements SubtractService {
+
+ public double subtract(double n1, double n2) {
+ System.out.println("SubtractService - subtract " + n1 + " and " + n2);
+ return n1 - n2;
+ }
+
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/distributed/impl/InMemoryTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/distributed/impl/InMemoryTestCase.java?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/distributed/impl/InMemoryTestCase.java (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/java/org/apache/tuscany/sca/distributed/impl/InMemoryTestCase.java Fri Sep 14 04:06:59 2007
@@ -0,0 +1,111 @@
+/*
+ * 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.distributed.impl;
+
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.node.impl.NodeImpl;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import calculator.CalculatorService;
+
+/**
+ * Runs a distributed domain in a single VM by using and in memory
+ * implementation of the distributed domain
+ */
+public class InMemoryTestCase {
+
+ private static String DEFULT_DOMAIN_NAME = "mydomain";
+
+ private static NodeImpl registry;
+ private static NodeImpl domainNodeA;
+ private static NodeImpl domainNodeB;
+ private static NodeImpl domainNodeC;
+ private static CalculatorService calculatorServiceA;
+ private static CalculatorService calculatorServiceB;
+
+ @BeforeClass
+ public static void init() throws Exception {
+
+ try {
+ System.out.println("Setting up domain registry");
+
+ registry = new NodeImpl();
+ registry.start();
+ registry.getContributionManager().startContribution(InMemoryTestCase.class.getClassLoader().getResource("domain/"));
+
+ System.out.println("Setting up calculator ");
+
+ // Create the domain representation
+ domainNodeA = new NodeImpl(DEFULT_DOMAIN_NAME, "nodeA");
+ domainNodeA.start();
+ domainNodeA.getContributionManager().startContribution(InMemoryTestCase.class.getClassLoader().getResource("nodeA/"));
+
+ // Create the domain representation
+ domainNodeB = new NodeImpl(DEFULT_DOMAIN_NAME, "nodeB");
+ domainNodeB.start();
+ domainNodeB.getContributionManager().startContribution(InMemoryTestCase.class.getClassLoader().getResource("nodeB/"));
+
+ // create the node that runs the
+ // subtract component
+ domainNodeC = new NodeImpl(DEFULT_DOMAIN_NAME, "nodeC");
+ domainNodeC.start();
+ domainNodeC.getContributionManager().startContribution(InMemoryTestCase.class.getClassLoader().getResource("nodeC/"));
+
+ // get a reference to the calculator service from domainA
+ // which will be running this component
+ calculatorServiceA = domainNodeA.getService(CalculatorService.class, "CalculatorServiceComponent");
+ } catch(Exception ex){
+ System.err.println(ex.toString());
+ }
+
+ // get a reference to the calculator service from domainA
+ // which will be running this component
+ calculatorServiceA = domainNodeA.getService(CalculatorService.class, "CalculatorServiceComponent1");
+ calculatorServiceB = domainNodeB.getService(CalculatorService.class, "CalculatorServiceComponent");
+
+ }
+
+ @AfterClass
+ public static void destroy() throws Exception {
+ // stop the nodes and hence the domains they contain
+ domainNodeA.stop();
+ domainNodeB.stop();
+ domainNodeC.stop();
+ }
+
+ @Test
+ public void testCalculator() throws Exception {
+
+ // Calculate
+ Assert.assertEquals(calculatorServiceA.add(3, 2), 5.0);
+ Assert.assertEquals(calculatorServiceA.subtract(3, 2), 1.0);
+ Assert.assertEquals(calculatorServiceA.multiply(3, 2), 6.0);
+ Assert.assertEquals(calculatorServiceA.divide(3, 2), 1.5);
+ Assert.assertEquals(calculatorServiceB.add(3, 2), 5.0);
+ Assert.assertEquals(calculatorServiceB.subtract(3, 2), 1.0);
+ Assert.assertEquals(calculatorServiceB.multiply(3, 2), 6.0);
+ Assert.assertEquals(calculatorServiceB.divide(3, 2), 1.5);
+
+ }
+}
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/META-INF/sca-contribution.xml?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/META-INF/sca-contribution.xml Fri Sep 14 04:06:59 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://management"
+ xmlns:management="http://management">
+ <deployable composite="management:Management"/>
+</contribution>
\ No newline at end of file
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/management.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/management.composite?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/management.composite (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/_node/management.composite Fri Sep 14 04:06:59 2007
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://management"
+ xmlns:sample="http://management"
+ xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.0"
+ name="Management">
+
+ <component name="NodeManagerComponent">
+ <implementation.java class="org.apache.tuscany.sca.node.impl.NodeManagerServiceImpl"/>
+ <service name="NodeManagerInitService">
+ <interface.java interface="org.apache.tuscany.sca.node.NodeManagerInitService"/>
+ <binding.sca/>
+ </service>
+ <service name="NodeManagerService">
+ <interface.java interface="org.apache.tuscany.sca.node.NodeManagerService"/>
+ <tuscany:binding.jsonrpc uri="http://localhost:8082/NodeManagerComponent/NodeManagerJson"/>
+ </service>
+ <service name="ComponentManagerService">
+ <interface.java interface="org.apache.tuscany.sca.node.ComponentManagerService"/>
+ <tuscany:binding.jsonrpc uri="http://localhost:8082/NodeManagerComponent/ComponentManagerJson"/>
+ </service>
+ </component>
+
+ <component name="DomainManagerComponent">
+ <implementation.java class="org.apache.tuscany.sca.node.impl.DomainManagerProxyImpl"/>
+ <reference name="domainManager">
+ <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerService"/>
+ <binding.ws uri="http://localhost:8080/DomainManagerComponent/DomainManager"/>
+ </reference>
+ </component>
+
+ <component name="ServiceDiscoveryComponent">
+ <implementation.java class="org.apache.tuscany.sca.node.impl.ServiceDiscoveryProxyImpl" />
+ <reference name="serviceDiscovery">
+ <binding.ws uri="http://localhost:8080/ServiceDiscoveryComponent/ServiceDiscovery"/>
+ </reference>
+ </component>
+
+ <component name="node">
+ <service name="Resource">
+ <tuscany:binding.http uri="http://localhost:8082/node"/>
+ </service>
+ <tuscany:implementation.resource location="webroot"/>
+ </component>
+
+
+</composite>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/META-INF/sca-contribution.xml?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/META-INF/sca-contribution.xml Fri Sep 14 04:06:59 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Domain"/>
+</contribution>
\ No newline at end of file
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/domain.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/domain.composite?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/domain.composite (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/domain/domain.composite Fri Sep 14 04:06:59 2007
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Domain">
+
+ <component name="DomainManagerComponent">
+ <implementation.java class="org.apache.tuscany.sca.domain.impl.DomainManagerServiceImpl"/>
+ <service name="DomainManagerService">
+ <interface.java interface="org.apache.tuscany.sca.domain.DomainManagerService"/>
+ <binding.ws uri="http://localhost:8080/DomainManagerComponent/DomainManager"/>
+ </service>
+ <reference name="serviceDiscovery" target="ServiceDiscoveryComponent"/>
+ </component>
+
+ <component name="ServiceDiscoveryComponent">
+ <implementation.java class="org.apache.tuscany.sca.domain.impl.ServiceDiscoveryServiceImpl" />
+ <service name="ServiceDiscoveryService">
+ <interface.java interface="org.apache.tuscany.sca.domain.ServiceDiscoveryService"/>
+ <binding.sca uri="http://localhost:8080/ServiceDiscoveryComponent/ServiceDiscovery"/>
+ <binding.ws uri="http://localhost:8080/ServiceDiscoveryComponent/ServiceDiscovery"/>
+ </service>
+ </component>
+
+</composite>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/Calculator.composite Fri Sep 14 04:06:59 2007
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample"
+ name="Calculator">
+
+ <component name="CalculatorServiceComponent1">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent"/>
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component>
+
+ <!--component name="CalculatorServiceComponent2">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService">
+ <interface.java interface="calculator.AddService"/>
+ <binding.ws wsdlElement="http://calculator/add#wsdl.port(AddService/AddSoapPort)"/>
+ </reference>
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent1"/>
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component-->
+
+ <!--component name="CalculatorServiceComponent3">
+ <implementation.java class="calculator.CalculatorServiceImpl"/>
+ <reference name="addService" target="AddServiceComponent" />
+ <reference name="subtractService" target="SubtractServiceComponent" />
+ <reference name="multiplyService" target="MultiplyServiceComponent">
+ <interface.java interface="calculator.MultiplyService" />
+ <binding.ws wsdlElement="http://calculator/multiply#wsdl.binding(MultiplySoapBinding)"/>
+ </reference>
+ <reference name="divideService" target="DivideServiceComponent" />
+ </component-->
+
+ <!--component name="AddServiceComponent">
+ <implementation.java class="calculator.AddServiceImpl"/>
+ <service name="AddService">
+ <interface.java interface="calculator.AddService" />
+ <binding.ws wsdlElement="http://calculator/add#wsdl.port(AddService/AddSoapPort)"/>
+ </service>
+ </component-->
+
+ <!--component name="SubtractServiceComponent1">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ </component-->
+
+ <!--component name="SubtractServiceComponent">
+ <implementation.java class="calculator.SubtractServiceImpl"/>
+ <service name="SubtractService">
+ <interface.java interface="calculator.SubtractService" />
+ <binding.sca uri="http://localhost:8087/SomeService"/>
+ <binding.ws wsdlElement="http://calculator/subtract#wsdl.port(SubtractService/SubtractSoapPort)"/>
+ </service>
+ </component-->
+
+ <component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl" />
+ </component>
+
+ <!--component name="MultiplyServiceComponent">
+ <implementation.java class="calculator.MultiplyServiceImpl" />
+ <service>
+ <interface.java interface="calculator.MultiplyService" />
+ <binding.ws wsdlElement="http://calculator/multiply#wsdl.binding(MultiplySoapBinding)"/>
+ </service>
+ </component-->
+
+ <component name="DivideServiceComponent">
+ <implementation.java class="calculator.DivideServiceImpl" />
+ </component>
+
+</composite>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml Fri Sep 14 04:06:59 2007
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
+ targetNamespace="http://sample"
+ xmlns:sample="http://sample">
+ <deployable composite="sample:Calculator"/>
+</contribution>
\ No newline at end of file
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/add.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/add.wsdl?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/add.wsdl (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/add.wsdl Fri Sep 14 04:06:59 2007
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://calculator/add"
+ xmlns:tns="http://calculator/add"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="add">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://calculator/add"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="add">
+ <complexType>
+ <sequence>
+ <element name="n1" type="xsd:double"/>
+ <element name="n2" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="addResponse">
+ <complexType>
+ <sequence>
+ <element name="response" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="addRequest">
+ <wsdl:part element="tns:add" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="addResponse">
+ <wsdl:part element="tns:addResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Add">
+ <wsdl:operation name="add">
+ <wsdl:input message="tns:addRequest" name="addRequest"/>
+ <wsdl:output message="tns:addResponse" name="addResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="AddSoapBinding" type="tns:Add">
+ <wsdlsoap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="add">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="addRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="addResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="AddService">
+ <wsdl:port binding="tns:AddSoapBinding" name="AddSoapPort">
+ <!--wsdlsoap:address location="http://localhost:8085/sample-calculator-webapp-ws/services/AddService"/-->
+ <wsdlsoap:address location="http://localhost:8085/AddServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/multiply.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/multiply.wsdl?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/multiply.wsdl (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/multiply.wsdl Fri Sep 14 04:06:59 2007
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://calculator/multiply"
+ xmlns:tns="http://calculator/multiply"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="multiply">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://calculator/multiply"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="multiply">
+ <complexType>
+ <sequence>
+ <element name="n1" type="xsd:double"/>
+ <element name="n2" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="multiplyResponse">
+ <complexType>
+ <sequence>
+ <element name="response" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="multiplyRequest">
+ <wsdl:part element="tns:multiply" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="multiplyResponse">
+ <wsdl:part element="tns:multiplyResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Multiply">
+ <wsdl:operation name="multiply">
+ <wsdl:input message="tns:multiplyRequest" name="multiplyRequest"/>
+ <wsdl:output message="tns:multiplyResponse" name="multiplyResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="MultiplySoapBinding" type="tns:Multiply">
+ <wsdlsoap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="multiply">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="multiplyRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="multiplyResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+</wsdl:definitions>
Added: incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/subtract.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/subtract.wsdl?rev=575620&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/subtract.wsdl (added)
+++ incubator/tuscany/java/sca/modules/node-impl/src/test/resources/nodeA/wsdl/subtract.wsdl Fri Sep 14 04:06:59 2007
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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.
+-->
+<wsdl:definitions targetNamespace="http://calculator/subtract"
+ xmlns:tns="http://calculator/subtract"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ name="subtract">
+
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://calculator/subtract"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+
+ <element name="subtract">
+ <complexType>
+ <sequence>
+ <element name="n1" type="xsd:double"/>
+ <element name="n2" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ <element name="subtractResponse">
+ <complexType>
+ <sequence>
+ <element name="response" type="xsd:double"/>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="subtractRequest">
+ <wsdl:part element="tns:subtract" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:message name="subtractResponse">
+ <wsdl:part element="tns:subtractResponse" name="parameters"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Subtract">
+ <wsdl:operation name="subtract">
+ <wsdl:input message="tns:subtractRequest" name="subtractRequest"/>
+ <wsdl:output message="tns:subtractResponse" name="subtractResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <wsdl:binding name="SubtractSoapBinding" type="tns:Subtract">
+ <wsdlsoap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="subtract">
+ <wsdlsoap:operation soapAction=""/>
+ <wsdl:input name="subtractRequest">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="subtractResponse">
+ <wsdlsoap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <wsdl:service name="SubtractService">
+ <wsdl:port binding="tns:SubtractSoapBinding" name="SubtractSoapPort">
+ <wsdlsoap:address location="http://localhost:8088/SubtractServiceComponent"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org