From 6fadbc9cd1fcf03d0b3630f772d91df149b70428 Mon Sep 17 00:00:00 2001 From: lresende Date: Wed, 11 Nov 2009 23:07:19 +0000 Subject: Moving 1.x branches git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@835123 13f79535-47bb-0310-9956-ffa450edef68 --- .../sca/domain/impl/DomainManagerNodeImpl.java | 170 ------ .../sca/domain/impl/DomainManagerServiceImpl.java | 118 ---- .../sca/domain/impl/SCADomainFactoryImpl.java | 54 -- .../tuscany/sca/domain/impl/SCADomainImpl.java | 662 --------------------- .../tuscany/sca/domain/impl/SCADomainUtil.java | 86 --- .../management/impl/ContributionInfoImpl.java | 89 --- .../sca/domain/management/impl/DomainInfoImpl.java | 99 --- .../sca/domain/management/impl/NodeInfoImpl.java | 99 --- .../sca/domain/model/impl/CompositeImpl.java | 54 -- .../sca/domain/model/impl/ContributionImpl.java | 87 --- .../tuscany/sca/domain/model/impl/DomainImpl.java | 94 --- .../domain/model/impl/DomainModelFactoryImpl.java | 80 --- .../tuscany/sca/domain/model/impl/NodeImpl.java | 93 --- .../tuscany/sca/domain/model/impl/ServiceImpl.java | 89 --- .../src/main/resources/domain.composite | 49 -- .../src/main/resources/webroot/domain.png | Bin 718 -> 0 bytes .../src/main/resources/webroot/index.html | 139 ----- .../src/main/resources/webroot/node.png | Bin 296 -> 0 bytes .../src/main/resources/webroot/style.css | 176 ------ .../src/test/java/calculator/AddService.java | 31 - .../src/test/java/calculator/AddServiceImpl.java | 31 - .../test/java/calculator/CalculatorService.java | 35 -- .../java/calculator/CalculatorServiceImpl.java | 74 --- .../src/test/java/calculator/DivideService.java | 28 - .../test/java/calculator/DivideServiceImpl.java | 30 - .../src/test/java/calculator/MultiplyService.java | 28 - .../test/java/calculator/MultiplyServiceImpl.java | 30 - .../src/test/java/calculator/SubtractService.java | 31 - .../test/java/calculator/SubtractServiceImpl.java | 31 - .../sca/domain/impl/DomainImplTestCase.java | 93 --- .../src/test/resources/nodeA/Calculator.composite | 41 -- .../resources/nodeA/META-INF/sca-contribution.xml | 24 - .../src/test/resources/nodeB/Calculator.composite | 29 - 33 files changed, 2774 deletions(-) delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerNodeImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainFactoryImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainUtil.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/ContributionInfoImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/DomainInfoImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/NodeInfoImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/CompositeImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ContributionImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainModelFactoryImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/NodeImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/domain.composite delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/domain.png delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/index.html delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/node.png delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/style.css delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddService.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorService.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideService.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyService.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractService.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractServiceImpl.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/Calculator.composite delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml delete mode 100644 branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeB/Calculator.composite (limited to 'branches/sca-java-1.0.1/modules/domain-impl/src') diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerNodeImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerNodeImpl.java deleted file mode 100644 index d5a7cebf81..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerNodeImpl.java +++ /dev/null @@ -1,170 +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.domain.impl; - -import java.net.URL; -import java.util.logging.Logger; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.DomainException; -import org.apache.tuscany.sca.domain.SCADomain; -import org.apache.tuscany.sca.domain.SCADomainSPI; -import org.apache.tuscany.sca.domain.model.Domain; -import org.apache.tuscany.sca.node.NodeException; -import org.apache.tuscany.sca.node.SCANode; -import org.osoa.sca.CallableReference; -import org.osoa.sca.ServiceReference; - -/** - * A dummy representation of and SCA Node used simply to control the - * endpoint of a callable reference - * We can remove this if we change the runtime over to referencing the - * domain directly rather than going via the node. - * - * @version $Rev: 552343 $ $Date: 2007-09-09 23:54:46 +0100 (Sun, 09 Sep 2007) $ - */ -public class DomainManagerNodeImpl implements SCANode { - - private final static Logger logger = Logger.getLogger(DomainManagerNodeImpl.class.getName()); - - private String nodeEndpoint; - private SCADomain scaDomain = new DomainManagerDomainImpl(); - private SCADomainSPI realSCADomain = null; - - class DomainManagerDomainImpl implements SCADomainSPI { - public String addNode(String nodeURI, String nodeURL){ - return null; - } - - public String removeNode(String nodeURI){ - return null; - } - - public void registerContribution(String nodeURI, String contributionURI, String contributionURL) { - } - - public void unregisterContribution(String contributionURI){ - } - - public String registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){ - return null; - } - - public String removeServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName){ - return null; - } - - public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){ - if (nodeEndpoint != null){ - return nodeEndpoint; - } else { - return realSCADomain.findServiceEndpoint(domainUri, serviceName, bindingName); - } - - } - - public Domain getDomainModel(){ - return null; - } - - // SCADomain API methods - - public void start() throws DomainException { - } - - public void stop() throws DomainException { - } - - public String getURI(){ - return null; - } - - public void addContribution(String contributionURI, URL contributionURL) throws DomainException { - } - - public void removeContribution(String uri) throws DomainException { - } - - public void addDeploymentComposite(String contributionURI, String compositeXML) throws DomainException { - } - - public void addToDomainLevelComposite(QName compositeQName) throws DomainException { - } - - public void removeFromDomainLevelComposite(QName compositeQName) throws DomainException { - } - - public void startComposite(QName compositeName) throws DomainException { - } - - public void stopComposite(QName qname) throws DomainException { - } - - public > R cast(B target) throws IllegalArgumentException { - - return null; - } - - public B getService(Class businessInterface, String serviceName) { - return null; - } - - public ServiceReference getServiceReference(Class businessInterface, String name) { - return null; - } - - } - - public DomainManagerNodeImpl(SCADomainSPI scaDomain) { - this.realSCADomain = scaDomain; - } - - public void setNodeEndpoint(String nodeEndpoint) { - this.nodeEndpoint = nodeEndpoint; - } - - // API methods - - public void start() throws NodeException { - } - - public void stop() throws NodeException { - - } - - public String getURI(){ - return null; - } - - public SCADomain getDomain(){ - return scaDomain; - } - - public void addContribution(String contributionURI, URL contributionURL) throws NodeException { - } - - - public void deployComposite(QName compositeName) throws NodeException { - - } - - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerServiceImpl.java deleted file mode 100644 index b843bde72a..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/DomainManagerServiceImpl.java +++ /dev/null @@ -1,118 +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.domain.impl; - -import java.util.logging.Logger; - -import org.apache.tuscany.sca.domain.DomainManagerInitService; -import org.apache.tuscany.sca.domain.DomainManagerNodeEventService; -import org.apache.tuscany.sca.domain.SCADomainSPI; -import org.apache.tuscany.sca.domain.management.DomainInfo; -import org.apache.tuscany.sca.domain.management.DomainManagementService; -import org.apache.tuscany.sca.domain.management.NodeInfo; -import org.apache.tuscany.sca.domain.management.impl.DomainInfoImpl; -import org.apache.tuscany.sca.domain.management.impl.NodeInfoImpl; -import org.apache.tuscany.sca.domain.model.Domain; -import org.apache.tuscany.sca.domain.model.Node; -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-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -@Scope("COMPOSITE") -@Service(interfaces = {DomainManagerNodeEventService.class, DomainManagerInitService.class, DomainManagementService.class}) -public class DomainManagerServiceImpl implements DomainManagerNodeEventService, DomainManagerInitService, DomainManagementService { - - private final static Logger logger = Logger.getLogger(DomainManagerServiceImpl.class.getName()); - - private SCADomainSPI scaDomain; - - // DomainManagerInitService methods - - public void setDomain(SCADomainSPI scaDomain) { - this.scaDomain = scaDomain; - } - - // DomainManagerNodeEventService methods - - public String registerNode(String nodeURI, String nodeURL){ - return scaDomain.addNode(nodeURI, nodeURL); - } - - public String removeNode(String nodeURI){ - return scaDomain.removeNode(nodeURI); - } - - public void registerContribution(String nodeURI, String contributionURI, String contributionURL) { - scaDomain.registerContribution(nodeURI, contributionURI, contributionURL); - } - - public void unregisterContribution(String contributionURI){ - scaDomain.unregisterContribution(contributionURI); - } - - public String registerServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName, String URL){ - return scaDomain.registerServiceEndpoint(domainUri, nodeUri, serviceName, bindingName, URL); - } - - public String removeServiceEndpoint(String domainUri, String nodeUri, String serviceName, String bindingName){ - return scaDomain.removeServiceEndpoint(domainUri, nodeUri, serviceName, bindingName); - } - - - public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){ - return scaDomain.findServiceEndpoint(domainUri, serviceName, bindingName); - } - - // DomainManagementService methods - - public DomainInfo getDomainDescription(){ - - DomainInfo domainInfo = new DomainInfoImpl(); - Domain domain = scaDomain.getDomainModel(); - - domainInfo.setDomainURI(domain.getDomainURI()); - domainInfo.setDomainURL(domain.getDomainURL()); - domainInfo.getNodes().addAll(domain.getNodes().keySet()); - domainInfo.getContributions().addAll(domain.getContributions().keySet()); - domainInfo.getDeployedComposites().addAll(domain.getDeployedComposites().keySet()); - - return domainInfo; - } - - public NodeInfo getNodeDescription(String nodeURI){ - - NodeInfo nodeInfo = new NodeInfoImpl(); - Domain domain = scaDomain.getDomainModel(); - Node node = domain.getNodes().get(nodeURI); - - nodeInfo.setNodeURI(nodeURI); - nodeInfo.setNodeURL(node.getNodeURL()); - nodeInfo.getContributions().addAll(node.getContributions().keySet()); - nodeInfo.getDeployedComposites().addAll(node.getDeployedComposites().keySet()); - nodeInfo.getServices().addAll(node.getServices().keySet()); - - return nodeInfo; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainFactoryImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainFactoryImpl.java deleted file mode 100644 index 8f741d7ea9..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainFactoryImpl.java +++ /dev/null @@ -1,54 +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.domain.impl; - -import org.apache.tuscany.sca.domain.DomainException; -import org.apache.tuscany.sca.domain.SCADomain; -import org.apache.tuscany.sca.domain.SCADomainFactory; - -/** - * A finder for SCA domains. - * - * @version $Rev: 580520 $ $Date: 2007-09-29 00:50:25 +0100 (Sat, 29 Sep 2007) $ - */ -public class SCADomainFactoryImpl extends SCADomainFactory { - - - /** - * Returns a new SCA domain finder instance. - * - * @return a new SCA domain finder - */ - public SCADomainFactoryImpl() { - - } - - /** - * Finds an existing SCA domain. - * - * @param domainURI the URI of the domain, this is the endpoint - * URI of the domain administration service - * @return the SCA domain - */ - public SCADomain createSCADomain(String domainURI) throws DomainException { - return new SCADomainImpl(domainURI); - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java deleted file mode 100644 index cdbc8f799c..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainImpl.java +++ /dev/null @@ -1,662 +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.domain.impl; - -import java.net.URI; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -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.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.DeployedArtifact; -import org.apache.tuscany.sca.contribution.ModelFactoryExtensionPoint; -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.domain.DomainException; -import org.apache.tuscany.sca.domain.DomainManagerInitService; -import org.apache.tuscany.sca.domain.SCADomainSPI; -import org.apache.tuscany.sca.domain.model.Domain; -import org.apache.tuscany.sca.domain.model.DomainModelFactory; -import org.apache.tuscany.sca.domain.model.Node; -import org.apache.tuscany.sca.domain.model.Service; -import org.apache.tuscany.sca.domain.model.impl.DomainModelFactoryImpl; -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.node.NodeManagerService; -import org.apache.tuscany.sca.node.NodeFactoryImpl; -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; - -/** - * The SCA domain implementation. In Tuscany we currently have a model of the - * SCA Domain that relies on a central domain manager this class provides that - * central manager. - * - * @version $Rev: 552343 $ $Date: 2007-09-09 23:54:46 +0100 (Sun, 09 Sep 2007) $ - */ -public class SCADomainImpl implements SCADomainSPI { - - private final static Logger logger = Logger.getLogger(SCADomainImpl.class.getName()); - - // class loader used to get the runtime going - private ClassLoader domainClassLoader; - - // management runtime - private ReallySmallRuntime domainManagementRuntime; - private ContributionService domainManagementContributionService; - private Composite domainManagementComposite; - private DomainManagerNodeImpl domainManagerNode; - - // management services - private DomainManagerInitService domainManagerInitService; - - // The domain model - private DomainModelFactory domainModelFactory = new DomainModelFactoryImpl(); - private Domain domainModel; - private HashMap contributions = new HashMap(); - - - /** - * Create a domain giving the URI for the domain. - * - * @param domainUri - identifies what host and port the domain service is running on, e.g. http://localhost:8081 - * @throws ActivationException - */ - public SCADomainImpl(String domainURI) throws DomainException { - this.domainModel = domainModelFactory.createDomain(); - this.domainModel.setDomainURI(domainURI); - this.domainClassLoader = SCADomainImpl.class.getClassLoader(); - init(); - } - - /** - * Create the domain management runtime etc - */ - private void init() throws DomainException { - try { - // check whether domain uri is a url - URI tmpURI; - try { - tmpURI = new URI(domainModel.getDomainURI()); - if (tmpURI.isAbsolute()){ - domainModel.setDomainURL(tmpURI.toURL().toExternalForm()); - } - } catch(Exception ex) { - throw new ActivationException("domain uri " + - domainModel.getDomainURI() + - "must be a valid url"); - } - - // create a runtime for the domain management services to run on - domainManagementRuntime = new ReallySmallRuntime(domainClassLoader); - domainManagementRuntime.start(); - - // Create an in-memory domain level management composite - AssemblyFactory assemblyFactory = domainManagementRuntime.getAssemblyFactory(); - domainManagementComposite = assemblyFactory.createComposite(); - domainManagementComposite.setName(new QName(Constants.SCA10_NS, "domainManagement")); - domainManagementComposite.setURI(domainModel.getDomainURI() + "/Management"); - - // Set up the domain so that we can push in the node endpoint before we - // call a node - domainManagerNode = new DomainManagerNodeImpl(this); - ModelFactoryExtensionPoint factories = domainManagementRuntime.getExtensionPointRegistry().getExtensionPoint(ModelFactoryExtensionPoint.class); - NodeFactoryImpl domainFactory = new NodeFactoryImpl(domainManagerNode); - factories.addFactory(domainFactory); - - // Find the composite that will configure the domain - String domainCompositeName = "domain.composite"; - URL contributionURL = SCADomainUtil.findContributionFromComposite(domainClassLoader, domainCompositeName); - - if ( contributionURL != null ){ - logger.log(Level.INFO, "Domain management configured from " + contributionURL); - - // add node composite to the management domain - domainManagementContributionService = domainManagementRuntime.getContributionService(); - Contribution contribution = null; - - contribution = domainManagementContributionService.contribute(domainModel.getDomainURI(), - contributionURL, - false); - - Composite composite = null; - for (DeployedArtifact artifact: contribution.getArtifacts()) { - if (domainCompositeName.equals(artifact.getURI())) { - composite = (Composite)artifact.getModel(); - } - } - - if (composite != null) { - - domainManagementComposite.getIncludes().add(composite); - domainManagementRuntime.getCompositeBuilder().build(composite); - - // TODO fix up the domain manager URI to match the provided - // domain uri - - domainManagementRuntime.getCompositeActivator().activate(composite); - domainManagementRuntime.getCompositeActivator().start(composite); - - // get the management components out of the domain so that they - // can be configured/used. - domainManagerInitService = getService(DomainManagerInitService.class, - "DomainManagerComponent/DomainManagerInitService", - domainManagementRuntime, - domainManagementComposite); - domainManagerInitService.setDomain((SCADomainSPI)this); - - - } else { - throw new ActivationException("Domain management contribution " + - contributionURL + - " found but could not be loaded"); - } - } else { - throw new ActivationException("Domain management contribution " + - domainCompositeName + - " not found on the classpath"); - } - - } catch(Exception ex) { - throw new DomainException(ex); - } - } - - public Component getComponent(String componentName) { - for (Composite composite: domainManagementComposite.getIncludes()) { - for (Component component: composite.getComponents()) { - if (component.getName().equals(componentName)) { - return component; - } - } - } - return null; - } - - // SCADomain SPI methods - - public Domain getDomainModel(){ - return domainModel; - } - - public String addNode(String nodeURI, String nodeURL){ - // try and remove it first just in case it's already registered - removeNode(nodeURI); - - Node node = domainModelFactory.createNode(); - node.setNodeURI(nodeURI); - node.setNodeURL(nodeURL); - domainModel.getNodes().put(nodeURI, node); - - logger.log(Level.INFO, "Registered node: " + - nodeURI + - " at endpoint " + - nodeURL); - - return "DummyReturn"; - } - - public String removeNode(String nodeURI){ - - domainModel.getNodes().remove(nodeURI); - - logger.log(Level.INFO, "Removed node: " + nodeURI); - - return "DummyReturn"; - } - - - public void registerContribution(String nodeURI, String contributionURI, String contributionURL){ - try { - if ( domainModel.getContributions().containsKey(contributionURI) == false ){ - // add the contribution information to the domain model - org.apache.tuscany.sca.domain.model.Contribution contributionModel = - parseContribution(contributionURI, contributionURL); - } - - - // assign the contribution to the referenced node - } catch (Exception ex) { - logger.log(Level.SEVERE, "Exception when registering contribution " + - contributionURI + - ex.toString() ); - } - - } - - - public void unregisterContribution(String contributionURI){ - // TODO - - } - - public String registerServiceEndpoint(String domainURI, String nodeURI, String serviceName, String bindingName, String URL){ - // if the service name ends in a "/" remove it - String modifiedServiceName = null; - if ( serviceName.endsWith("/") ) { - modifiedServiceName = serviceName.substring(0, serviceName.length() - 1); - } else { - modifiedServiceName = serviceName; - } - - // collect the service info - Service service = domainModelFactory.createService(); - service.setServiceURI(modifiedServiceName); - service.setServiceURL(URL); - service.setServiceBinding(bindingName); - - // find the node - Node node = domainModel.getNodes().get(nodeURI); - - if (node != null){ - //store the service - node.getServices().put(serviceName+bindingName, service); - logger.log(Level.INFO, "Registered service: " + modifiedServiceName); - } else { - logger.log(Level.WARNING, "Trying to register service: " + - modifiedServiceName + - " for a node " + - nodeURI + - "that isn't registered"); - } - - return ""; - } - - public String removeServiceEndpoint(String domainUri, String nodeURI, String serviceName, String bindingName){ - Node node = domainModel.getNodes().get(nodeURI); - node.getServices().remove(serviceName + bindingName); - logger.log(Level.INFO, "Removed service: " + serviceName ); - - return ""; - } - - public String findServiceEndpoint(String domainUri, String serviceName, String bindingName){ - logger.log(Level.INFO, "Finding service: [" + - domainUri + " " + - serviceName + " " + - bindingName + - "]"); - - String url = ""; - String serviceKey = serviceName + bindingName; - - for (Node node : domainModel.getNodes().values()){ - Service service = node.getServices().get(serviceKey); - - if (service != null){ - url = service.getServiceURL(); - //url = replacePort(url, "8085", "8086"); - logger.log(Level.INFO, "Found service url: " + url); - break; - } - } - - return url; - } - - /** - * Converts a port number to something else to allow for debugging using a - * HTTP sniffer - * @param url - * @param fromPort the port to look for - * @param toPort the port to replace it with - * @return the new url - */ - private String replacePort(String url, String fromPort, String toPort) { - return url.replace(fromPort, toPort); - } - - - // SCADomain API methods - - public void start() throws DomainException { - // TODO - } - - - public void stop() throws DomainException { - try { - // Stop the node - domainManagementRuntime.stop(); - - } catch(ActivationException ex) { - throw new DomainException(ex); - } - - } - - public String getURI(){ - return domainModel.getDomainURI(); - } - - private org.apache.tuscany.sca.domain.model.Contribution parseContribution(String contributionURI, String contributionURL) throws DomainException { - // add the contribution information to the domain model - org.apache.tuscany.sca.domain.model.Contribution contributionModel = domainModelFactory.createContribution(); - contributionModel.setContributionURI(contributionURI); - contributionModel.setContributionURL(contributionURL); - domainModel.getContributions().put(contributionURI, contributionModel); - - // read the assembly model objects. - try { - // Create a local model from the contribution. Using the contribution - // processor from the domain management runtime just because we already have it - Contribution contribution = domainManagementContributionService.contribute(contributionURI, - new URL(contributionURL), - false); - - // store the contribution - contributions.put(contributionURI, contribution); - - // add the composite info to the domain model - for (DeployedArtifact artifact : contribution.getArtifacts()) { - if (artifact.getModel() instanceof Composite) { - Composite composite = (Composite)artifact.getModel(); - org.apache.tuscany.sca.domain.model.Composite compositeModel = - domainModelFactory.createComposite(); - compositeModel.setCompositeQName(composite.getName()); - contributionModel.getComposites().put(compositeModel.getCompositeQName(), compositeModel); - - } - } - - // add all composites into the domain model - for (Composite composite : contribution.getDeployables()) { - org.apache.tuscany.sca.domain.model.Composite compositeModel = - domainModelFactory.createComposite(); - compositeModel.setCompositeQName(composite.getName()); - contributionModel.getComposites().put(compositeModel.getCompositeQName(), compositeModel); - } - - // add the deployable composite info to the domain model - for (Composite composite : contribution.getDeployables()) { - org.apache.tuscany.sca.domain.model.Composite compositeModel = - contributionModel.getComposites().get(composite.getName()); - contributionModel.getDeployableComposites().put(compositeModel.getCompositeQName(), compositeModel); - domainModel.getDeployedComposites().put(compositeModel.getCompositeQName(), compositeModel); - } - - } catch(Exception ex) { - throw new DomainException(ex); - } - - return contributionModel; - } - - private void assignContributionToNode(org.apache.tuscany.sca.domain.model.Contribution contributionModel) throws DomainException { - // Find a node to run the contribution. - // TODO - add some more sophisticated algorithm here - // find a node without a contribution and add it to it. There is no deployment - // step here we just assume the contribution is available. - - boolean foundFreeNode = false; - - for(Node node : domainModel.getNodes().values()) { - if ( node.getContributions().isEmpty()){ - foundFreeNode = true; - node.getContributions().put(contributionModel.getContributionURI(), contributionModel); - break; - } - } - - if (foundFreeNode == false){ - throw new DomainException("No free node available for contribution " + - contributionModel.getContributionURI()); - } - } - - public void addContribution(String contributionURI, URL contributionURL) throws DomainException { - // add the contribution information to the domain model - org.apache.tuscany.sca.domain.model.Contribution contributionModel = - parseContribution(contributionURI, contributionURL.toExternalForm()); - - assignContributionToNode(contributionModel); - } - - public void removeContribution(String uri) throws DomainException { - - // TODO - } - - public void addDeploymentComposite(String contributionURI, String compositeXML) throws DomainException { - // TODO - } - - public void addToDomainLevelComposite(QName compositeName) throws DomainException { - // find the nodes with this composite and add the composite as a deployable composite - for ( Node node : domainModel.getNodes().values()) { - for (org.apache.tuscany.sca.domain.model.Contribution contribution : node.getContributions().values()){ - org.apache.tuscany.sca.domain.model.Composite composite = - contribution.getComposites().get(compositeName); - if (composite != null) { - contribution.getDeployableComposites().put(compositeName, composite); - domainModel.getDeployedComposites().put(compositeName, composite); - } - } - } - } - - public void removeFromDomainLevelComposite(QName qname) throws DomainException { - // TODO - } - - public void startComposite(QName compositeName) throws DomainException { - for (Node node : domainModel.getNodes().values()){ - boolean startNode = false; - - for (org.apache.tuscany.sca.domain.model.Contribution contribution : node.getContributions().values()){ - org.apache.tuscany.sca.domain.model.Composite composite = - contribution.getDeployableComposites().get(compositeName); - if (composite != null) { - startNode = true; - break; - } - } - - if (startNode == true){ - // get the endpoint of the node in question and set it into the - // domain manager node in order to flip the node reference to - // the correct endpoint - String nodeURL = node.getNodeURL(); - domainManagerNode.setNodeEndpoint(nodeURL); - - - // get a node manager service reference. This will have to have its - // physical endpoint set by the domain node manage we have just - // configured - NodeManagerService nodeManagerService = getService(NodeManagerService.class, - "NodeManagerComponent/NodeManagerService", - domainManagementRuntime, - domainManagementComposite); - - // add contributions - for (org.apache.tuscany.sca.domain.model.Contribution contribution : node.getContributions().values()){ - nodeManagerService.addContribution(contribution.getContributionURI(), - contribution.getContributionURL().toString()); - } - - // deploy composite - nodeManagerService.deployComposite(compositeName.toString()); - - // start node - nodeManagerService.start(); - - // TODO - // somewhere we need to add the deployed composites into the node model - - // reset the endpoint setting function - domainManagerNode.setNodeEndpoint(null); - } - } - } - - public void stopComposite(QName qname) throws DomainException { - // TODO - } - - public > R cast(B target) throws IllegalArgumentException { - return (R)cast(target, domainManagementRuntime); - } - - private > R cast(B target, ReallySmallRuntime runtime) throws IllegalArgumentException { - return (R)runtime.getProxyFactory().cast(target); - } - - public B getService(Class businessInterface, String serviceName) { - return getService( businessInterface, serviceName, domainManagementRuntime, null); - } - - private B getService(Class businessInterface, String serviceName, ReallySmallRuntime runtime, Composite domainComposite) { - - ServiceReference serviceReference = getServiceReference(businessInterface, serviceName, runtime, domainComposite); - if (serviceReference == null) { - throw new ServiceRuntimeException("Service not found: " + serviceName); - } - return serviceReference.getService(); - } - - private ServiceReference createServiceReference(Class businessInterface, String targetURI) { - return createServiceReference(businessInterface, targetURI, domainManagementRuntime, null); - } - - - private ServiceReference createServiceReference(Class businessInterface, String targetURI, ReallySmallRuntime runtime, Composite domainComposite) { - try { - - AssemblyFactory assemblyFactory = runtime.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"); - runtime.getCompositeActivator().configureComponentContext(component); - composite.getComponents().add(component); - RuntimeComponentReference reference = (RuntimeComponentReference)assemblyFactory.createComponentReference(); - reference.setName("default"); - ModelFactoryExtensionPoint factories = - runtime.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(businessInterface, component, reference, binding, runtime - .getProxyFactory(), runtime.getCompositeActivator()); - } catch (Exception e) { - throw new ServiceRuntimeException(e); - } - } - - - - public ServiceReference getServiceReference(Class businessInterface, String name) { - return getServiceReference(businessInterface, name, domainManagementRuntime, null); - } - - - private ServiceReference getServiceReference(Class businessInterface, String name, ReallySmallRuntime runtime, Composite domainComposite) { - - // 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 - Component component = null; - - if ( domainComposite != null ) { - for (Composite composite: domainComposite.getIncludes()) { - for (Component compositeComponent: composite.getComponents()) { - if (compositeComponent.getName().equals(componentName)) { - component = compositeComponent; - } - } - } - } - - if (component == null) { - // The component is not local in the partition, try to create a remote service ref - return createServiceReference(businessInterface, name, runtime, domainComposite); - } - 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); - } - } - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainUtil.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainUtil.java deleted file mode 100644 index df618458d4..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/impl/SCADomainUtil.java +++ /dev/null @@ -1,86 +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.domain.impl; - -import java.io.IOException; -import java.net.InetAddress; -import java.net.MalformedURLException; -import java.net.ServerSocket; -import java.net.URI; -import java.net.URL; -import java.net.UnknownHostException; -import java.util.List; -import java.util.logging.Logger; - -import org.apache.tuscany.sca.assembly.Binding; -import org.apache.tuscany.sca.assembly.Component; -import org.apache.tuscany.sca.assembly.ComponentReference; -import org.apache.tuscany.sca.assembly.ComponentService; -import org.apache.tuscany.sca.assembly.SCABinding; -import org.apache.tuscany.sca.contribution.Contribution; -import org.apache.tuscany.sca.contribution.service.util.FileHelper; -import org.apache.tuscany.sca.core.assembly.ActivationException; - - -/** - * Some utility methods for the Domain implementation - * - * @version $Rev: 556897 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class SCADomainUtil { - private final static Logger logger = Logger.getLogger(SCADomainUtil.class.getName()); - - /** - * Given the name of a composite this method finds the contribution that it belongs to - * this could be either a local directory of a jar file. - * - * @param classLoader - * @param compositeString - * @return the contribution URL - * @throws MalformedURLException - */ - public static URL findContributionFromComposite(ClassLoader classLoader, String compositeString) - throws MalformedURLException { - - URL contributionURL = classLoader.getResource(compositeString); - - if ( contributionURL != null ){ - String contributionURLString = contributionURL.toExternalForm(); - String protocol = contributionURL.getProtocol(); - - if ("file".equals(protocol)) { - // directory contribution - if (contributionURLString.endsWith(compositeString)) { - String location = contributionURLString.substring(0, contributionURLString.lastIndexOf(compositeString)); - // workaround from evil url/uri form maven - contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL(); - } - - } else if ("jar".equals(protocol)) { - // jar contribution - String location = contributionURLString.substring(4, contributionURLString.lastIndexOf("!/")); - // workaround for evil url/uri from maven - contributionURL = FileHelper.toFile(new URL(location)).toURI().toURL(); - } - } - - return contributionURL; - } -} \ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/ContributionInfoImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/ContributionInfoImpl.java deleted file mode 100644 index 090bf21fc1..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/ContributionInfoImpl.java +++ /dev/null @@ -1,89 +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.domain.management.impl; - -import java.io.Serializable; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.management.ContributionInfo; -/** - * Information relating to an exposed service - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class ContributionInfoImpl implements ContributionInfo, Serializable { - - static final long serialVersionUID = 7669181086005969428L; - - private String contributionURI; - private URL contributionURL; - private List composites = new ArrayList(); - private List deployableComposites = new ArrayList(); - - - /** - * Retrieve the contribution uri - * - * @return contribution uri - */ - public String getContributionURI() { - return contributionURI; - } - - /** - * Set the contribution uri - * - * @param contributionURI - */ - public void setContributionURI(String contributionURI){ - this.contributionURI = contributionURI; - } - - /** - * Retrieve the contribution url - * - * @return contribution url - */ - public URL getContributionURL(){ - return contributionURL; - } - - /** - * Set the contribution url - * - * @param contributionURL - */ - public void setContributionURL(URL contributionURL){ - this.contributionURL = contributionURL; - } - - public List getComposites(){ - return composites; - } - - public List getDeployableComposites(){ - return deployableComposites; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/DomainInfoImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/DomainInfoImpl.java deleted file mode 100644 index b331d366a7..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/DomainInfoImpl.java +++ /dev/null @@ -1,99 +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.domain.management.impl; - -import java.io.Serializable; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.management.DomainInfo; -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; -import org.apache.tuscany.sca.domain.model.Node; - -/** - * A data transport object for the management interface - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class DomainInfoImpl implements DomainInfo, Serializable { - - static final long serialVersionUID = 7669181086005969428L; - - private String domainURI; - private String domainURL; - private List nodes = new ArrayList(); - private List contributions = new ArrayList(); - private List composites = new ArrayList(); - - /** - * Retrieve the domain uri - * - * @return domain uri - */ - public String getDomainURI(){ - return domainURI; - } - - /** - * Set the domain uri - * - * @param domainURI - */ - public void setDomainURI(String domainURI){ - this.domainURI = domainURI; - } - - /** - * Retrieve the domain url - * - * @return domain url - */ - public String getDomainURL(){ - return domainURL; - } - - /** - * Set the domain url - * - * @param domainURL - */ - public void setDomainURL(String domainURL){ - this.domainURL = domainURL; - } - - public List getNodes(){ - return nodes; - } - - public List getContributions(){ - return contributions; - } - - public List getDeployedComposites(){ - return composites; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/NodeInfoImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/NodeInfoImpl.java deleted file mode 100644 index 1d547d33d7..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/management/impl/NodeInfoImpl.java +++ /dev/null @@ -1,99 +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.domain.management.impl; - -import java.io.Serializable; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.management.NodeInfo; -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; -import org.apache.tuscany.sca.domain.model.Service; - -/** - * Information relating to an exposed service - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class NodeInfoImpl implements NodeInfo, Serializable { - - static final long serialVersionUID = 7669181086005969428L; - - private String nodeURI; - private String nodeURL; - private List contributions = new ArrayList(); - private List composites = new ArrayList(); - private List services = new ArrayList(); - - /** - * Retrieve the node uri - * - * @return node uri - */ - public String getNodeURI(){ - return nodeURI; - } - - /** - * Set the node uri - * - * @param nodeURI - */ - public void setNodeURI(String nodeURI){ - this.nodeURI = nodeURI; - } - - /** - * Retrieve the node url - * - * @return node url - */ - public String getNodeURL() { - return nodeURL; - } - - /** - * Set the node url - * - * @param nodeURL - */ - public void setNodeURL(String nodeURL){ - this.nodeURL = nodeURL; - } - - public List getContributions(){ - return contributions; - } - - public List getDeployedComposites(){ - return composites; - } - - public List getServices(){ - return services; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/CompositeImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/CompositeImpl.java deleted file mode 100644 index f2717aeeef..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/CompositeImpl.java +++ /dev/null @@ -1,54 +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.domain.model.impl; - - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.model.Composite; - - -/** - * A composite. - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class CompositeImpl implements Composite { - - private QName compositeQName; - - /** - * Retrieve the composite qname - * - * @return composite qname - */ - public QName getCompositeQName(){ - return compositeQName; - } - - /** - * Set the composite qname - * - * @param compositeQName - */ - public void setCompositeQName(QName compositeQName) { - this.compositeQName = compositeQName; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ContributionImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ContributionImpl.java deleted file mode 100644 index ed2456067e..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ContributionImpl.java +++ /dev/null @@ -1,87 +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.domain.model.impl; - -import java.net.URL; -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; - -/** - * A contribution. - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class ContributionImpl implements Contribution { - - private String contributionURI; - private String contributionURL; - private Map composites = new HashMap(); - private Map deployableComposites = new HashMap(); - - - /** - * Retrieve the contribution uri - * - * @return contribution uri - */ - public String getContributionURI() { - return contributionURI; - } - - /** - * Set the contribution uri - * - * @param contributionURI - */ - public void setContributionURI(String contributionURI){ - this.contributionURI = contributionURI; - } - - /** - * Retrieve the contribution url - * - * @return contribution url - */ - public String getContributionURL(){ - return contributionURL; - } - - /** - * Set the contribution url - * - * @param contributionURL - */ - public void setContributionURL(String contributionURL){ - this.contributionURL = contributionURL; - } - - public Map getComposites(){ - return composites; - } - - public Map getDeployableComposites(){ - return deployableComposites; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainImpl.java deleted file mode 100644 index 0f6af482f7..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainImpl.java +++ /dev/null @@ -1,94 +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.domain.model.impl; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; -import org.apache.tuscany.sca.domain.model.Node; -import org.apache.tuscany.sca.domain.model.Domain; - - -/** - * A domain. Manages nodes - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class DomainImpl implements Domain { - - private String domainURI; - private String domainURL; - private Map nodes = new HashMap(); - private Map contributions = new HashMap(); - private Map composites = new HashMap(); - - - /** - * Retrieve the domain uri - * - * @return domain uri - */ - public String getDomainURI(){ - return domainURI; - } - - /** - * Set the domain uri - * - * @param domainURI - */ - public void setDomainURI(String domainURI){ - this.domainURI = domainURI; - } - - /** - * Retrieve the domain url - * - * @return domain url - */ - public String getDomainURL(){ - return domainURL; - } - - /** - * Set the domain url - * - * @param domainURL - */ - public void setDomainURL(String domainURL){ - this.domainURL = domainURL; - } - - public Map getNodes(){ - return nodes; - } - - public Map getContributions(){ - return contributions; - } - - public Map getDeployedComposites(){ - return composites; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainModelFactoryImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainModelFactoryImpl.java deleted file mode 100644 index 768f2658a4..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/DomainModelFactoryImpl.java +++ /dev/null @@ -1,80 +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.domain.model.impl; - -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; -import org.apache.tuscany.sca.domain.model.Domain; -import org.apache.tuscany.sca.domain.model.DomainModelFactory; -import org.apache.tuscany.sca.domain.model.Node; -import org.apache.tuscany.sca.domain.model.Service; - -/** - * A node. Runs SCA composites - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class DomainModelFactoryImpl implements DomainModelFactory { - - /** - * Create a new domain model - * - * @return new domain model - */ - public Domain createDomain(){ - return new DomainImpl(); - } - /** - * Create a new node model - * - * @return new node model - */ - public Node createNode(){ - return new NodeImpl(); - } - - /** - * Create a new contribution model - * - * @return new contribution model - */ - public Contribution createContribution(){ - return new ContributionImpl(); - } - - /** - * Create a new composite model - * - * @return new composite model - */ - public Composite createComposite(){ - return new CompositeImpl(); - } - - /** - * Create a new service model - * - * @return new service model - */ - public Service createService(){ - return new ServiceImpl(); - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/NodeImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/NodeImpl.java deleted file mode 100644 index dc6454bf7e..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/NodeImpl.java +++ /dev/null @@ -1,93 +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.domain.model.impl; - -import java.util.HashMap; -import java.util.Map; - -import javax.xml.namespace.QName; - -import org.apache.tuscany.sca.domain.model.Composite; -import org.apache.tuscany.sca.domain.model.Contribution; -import org.apache.tuscany.sca.domain.model.Node; -import org.apache.tuscany.sca.domain.model.Service; - - -/** - * A node. Runs SCA composites - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class NodeImpl implements Node { - - private String nodeURI; - private String nodeURL; - private Map contributions = new HashMap(); - private Map composites = new HashMap(); - private Map services = new HashMap(); - - /** - * Retrieve the node uri - * - * @return node uri - */ - public String getNodeURI(){ - return nodeURI; - } - - /** - * Set the node uri - * - * @param nodeURI - */ - public void setNodeURI(String nodeURI){ - this.nodeURI = nodeURI; - } - - /** - * Retrieve the node url - * - * @return node url - */ - public String getNodeURL() { - return nodeURL; - } - - /** - * Set the node url - * - * @param nodeURL - */ - public void setNodeURL(String nodeURL){ - this.nodeURL = nodeURL; - } - - public Map getContributions(){ - return contributions; - } - - public Map getDeployedComposites(){ - return composites; - } - - public Map getServices(){ - return services; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ServiceImpl.java deleted file mode 100644 index bf2ec8a6a3..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/java/org/apache/tuscany/sca/domain/model/impl/ServiceImpl.java +++ /dev/null @@ -1,89 +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.domain.model.impl; - -import org.apache.tuscany.sca.domain.model.Service; - -/** - * A service. - * - * @version $Rev: 552343 $ $Date: 2007-09-07 12:41:52 +0100 (Fri, 07 Sep 2007) $ - */ -public class ServiceImpl implements Service { - - private String serviceURI; - private String serviceURL; - private String serviceBinding; - - /** - * Retrieve the service uri - * - * @return service uri - */ - public String getServiceURI(){ - return serviceURI; - } - - /** - * Set the service uri - * - * @param serviceURI - */ - public void setServiceURI(String serviceURI){ - this.serviceURI = serviceURI; - } - - /** - * Retrieve the service url - * - * @return service url - */ - public String getServiceURL(){ - return serviceURL; - } - - /** - * Set the service url - * - * @param serviceURL - */ - public void setServiceURL(String serviceURL){ - this.serviceURL = serviceURL; - } - - - /** - * Retrieve the service binding - * - * @return service binding - */ - public String getServiceBinding(){ - return serviceBinding; - } - - /** - * Set the service binding - * - * @param serviceBinding - */ - public void setServiceBinding(String serviceBinding){ - this.serviceBinding = serviceBinding; - } -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/domain.composite b/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/domain.composite deleted file mode 100644 index ec41d74836..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/domain.composite +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/domain.png b/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/domain.png deleted file mode 100644 index e88c4f882a..0000000000 Binary files a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/domain.png and /dev/null differ diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/index.html b/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/index.html deleted file mode 100644 index 1c387ed50d..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/index.html +++ /dev/null @@ -1,139 +0,0 @@ - - - -Apache Tuscany Domain - - - - - - - - - - -

Apache Tuscany Domain

-
- - - - - -
-
-
- -
- -

- - - diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/node.png b/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/node.png deleted file mode 100644 index fa01e64272..0000000000 Binary files a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/node.png and /dev/null differ diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/style.css b/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/style.css deleted file mode 100644 index 28a4d4540c..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/main/resources/webroot/style.css +++ /dev/null @@ -1,176 +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. - */ - -p,table,li,h1,h2,h3 -{ -font-family: verdana, arial, 'sans serif'; -} - -p, h1, h2, h3, table, li, hr -{ -margin-left: 10pt; -} - -table -{ -border-color: black; -border-collapse: separate; -border-spacing: 0px 1px; - -margin-right: 10pt; -margin-left: 10pt; -width: 800px; -} - -.sourceDetailsTable -{ -width: 600px; -} - -tr, td -{ -margin-left: 0pt; -margin-right: 0pt; -padding-left: 10pt; -font-size: 90%; -} - -p,li,th -{ -font-size: 90%; -margin-left: 10pt; -} - -pre -{ -margin-left: 10pt; -} - -body -{ -#ffffff; -} - -h1,h2,h3,hr -{ -color: firebrick; -} - -a:link {COLOR: firebrick;} -a:visited {COLOR: firebrick;} -a:active {COLOR: navy;} - -.link -{ -COLOR: firebrick; -text-decoration: underline; -} - -.clickable -{ -cursor: pointer -} - -.unread_title -{ -font-weight: bold; -} - -.read_title -{ -font-weight: normal; -} - -.summary -{ -color: DimGrey; -} - -.hidden -{ -display: none; -} - -.source_name -{ -width: 600px; -} - -.alert_text -{ -width: 600px; -} - -.alert_data -{ -margin-left: 10px; -width: 800px; -height: 800px; -} - -.source_0 -{ -background-color: LightGreen; -} - -.source_1 -{ -background-color: LightSkyBlue; -} - -.source_2 -{ -background-color: Khaki; -} - -.source_3 -{ -background-color: LightPink; -} - -.source_4 -{ -background-color: Orange; -} - -.source_5 -{ -background-color: LightCoral; -} - -.source_6 -{ -background-color: Orchid; -} - -.source_7 -{ -background-color: Peru; -} - -.source_8 -{ -background-color: SpringGreen; -} - -.source_9 -{ -background-color: LightGrey; -} - diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddService.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddService.java deleted file mode 100644 index 797ebb4024..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddService.java +++ /dev/null @@ -1,31 +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.osoa.sca.annotations.Remotable; - -/** - * The Add service interface - */ -@Remotable -public interface AddService { - - double add(double n1, double n2); - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddServiceImpl.java deleted file mode 100644 index 1a63d4ff77..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/AddServiceImpl.java +++ /dev/null @@ -1,31 +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; - -/** - * 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; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorService.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorService.java deleted file mode 100644 index ad87375529..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorService.java +++ /dev/null @@ -1,35 +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; - - -/** - * 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); - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorServiceImpl.java deleted file mode 100644 index 8ee640ed6b..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/CalculatorServiceImpl.java +++ /dev/null @@ -1,74 +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.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); - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideService.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideService.java deleted file mode 100644 index ef6a8b375b..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideService.java +++ /dev/null @@ -1,28 +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; - -/** - * The divide service interface - */ -public interface DivideService { - - double divide(double n1, double n2); - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideServiceImpl.java deleted file mode 100644 index 8c33862f6d..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/DivideServiceImpl.java +++ /dev/null @@ -1,30 +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; - -/** - * An implementation of the Divide service. - */ -public class DivideServiceImpl implements DivideService { - - public double divide(double n1, double n2) { - return n1 / n2; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyService.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyService.java deleted file mode 100644 index db568cc762..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyService.java +++ /dev/null @@ -1,28 +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; - -/** - * The interface for the multiply service - */ -public interface MultiplyService { - - double multiply(double n1, double n2); - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyServiceImpl.java deleted file mode 100644 index c7fbc73c00..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/MultiplyServiceImpl.java +++ /dev/null @@ -1,30 +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; - -/** - * An implementation of the Multiply service. - */ -public class MultiplyServiceImpl implements MultiplyService { - - public double multiply(double n1, double n2) { - return n1 * n2; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractService.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractService.java deleted file mode 100644 index 615320e670..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractService.java +++ /dev/null @@ -1,31 +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.osoa.sca.annotations.Remotable; - -/** - * The interface for the multiply service - */ -@Remotable -public interface SubtractService { - - double subtract(double n1, double n2); - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractServiceImpl.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractServiceImpl.java deleted file mode 100644 index abf2777c7d..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/calculator/SubtractServiceImpl.java +++ /dev/null @@ -1,31 +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; - -/** - * 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; - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java b/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java deleted file mode 100644 index 21700ef056..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/java/org/apache/tuscany/sca/domain/impl/DomainImplTestCase.java +++ /dev/null @@ -1,93 +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.domain.impl; - -import java.net.URL; - -import org.apache.tuscany.sca.domain.SCADomain; -import org.apache.tuscany.sca.domain.SCADomainFactory; -import org.apache.tuscany.sca.domain.SCADomainSPI; -import org.apache.tuscany.sca.node.SCANode; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; - -import calculator.AddService; -import calculator.CalculatorService; - - -/** - * This server program that loads a composite to provide simple registry function. - * This server can be replaced with any registry that is appropriate but the components - * in each node that talk to the registry should be replaced also. - */ -public class DomainImplTestCase { - - private static String DEFAULT_DOMAIN_URI = "http://localhost:8877"; - - private static SCADomain domain; - private static SCADomainSPI domainSPI; - private static ClassLoader cl; - - @BeforeClass - public static void init() throws Exception { - - try { - cl = DomainImplTestCase.class.getClassLoader(); - SCADomainFactory domainFactory = SCADomainFactory.newInstance(); - domain = domainFactory.createSCADomain(DEFAULT_DOMAIN_URI); - domainSPI = (SCADomainSPI)domain; - - } catch (Exception e) { - e.printStackTrace(); - } - - System.out.println("Domain started"); - } - - @AfterClass - public static void destroy() throws Exception { - // stop the domain - domain.stop(); - System.out.println("Domain stopped"); - } - - @Test - public void testAddNode() throws Exception { - domainSPI.addNode("http://mynode1", "http://localhost:81"); - domainSPI.addNode("http://mynode2", "http://localhost:82"); - } - - @Test - public void testAddContributionWithMetaData() throws Exception { - domain.addContribution("contributionNodeA", cl.getResource("nodeA/")); - } - - @Test - public void testAddContributionWithoutMetaData() throws Exception { - domain.addContribution("contributionNodeB", cl.getResource("nodeB/")); - } - - //@Test - public void testKeepServerRunning() throws Exception { - System.out.println("press enter to continue"); - System.in.read(); - } - -} diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/Calculator.composite b/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/Calculator.composite deleted file mode 100644 index 7731cc7b55..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/Calculator.composite +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml b/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml deleted file mode 100644 index 3f9ed8024b..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeA/META-INF/sca-contribution.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - \ No newline at end of file diff --git a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeB/Calculator.composite b/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeB/Calculator.composite deleted file mode 100644 index 9d2a97b172..0000000000 --- a/branches/sca-java-1.0.1/modules/domain-impl/src/test/resources/nodeB/Calculator.composite +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - -- cgit v1.2.3