tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r951651 [9/13] - in /tuscany/sca-java-2.x/trunk/modules: assembly-xml/src/main/java/org/apache/tuscany/sca/assembly/xml/ assembly/src/main/java/org/apache/tuscany/sca/assembly/ assembly/src/main/java/org/apache/tuscany/sca/assembly/impl/ bi...
Date Sat, 05 Jun 2010 05:17:51 GMT
Modified: tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java Sat Jun  5 05:17:47 2010
@@ -1,278 +1,278 @@
-/*
- * 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.something.impl;
-
-import java.io.Reader;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.common.java.io.IOHelper;
-import org.apache.tuscany.sca.contribution.Artifact;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.ContributionMetadata;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.deployment.Deployer;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.apache.tuscany.sca.runtime.ActivationException;
-import org.apache.tuscany.sca.runtime.CompositeActivator;
-import org.apache.tuscany.sca.runtime.EndpointRegistry;
-import org.apache.tuscany.sca.something.Section10;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-import org.oasisopen.sca.client.SCAClientFactory;
-
-public class Section10Impl implements Section10 {
-
-    private String domainName;
-    private Deployer deployer;
-    private Map<String, InstalledContribution> installedContributions = new HashMap<String, InstalledContribution>();
-    private CompositeActivator compositeActivator;
-    private EndpointRegistry endpointRegistry;
-    private ExtensionPointRegistry extensionPointRegistry;
-    
-    public Section10Impl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry) {
-        this.domainName = domainName;
-        this.deployer = deployer;
-        this.compositeActivator = compositeActivator;
-        this.endpointRegistry = endpointRegistry;
-        this.extensionPointRegistry = extensionPointRegistry;
-    }
-
-    public void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException {
-        Monitor monitor = deployer.createMonitor();
-        Contribution contribution = deployer.loadContribution(URI.create(uri), IOHelper.getLocationAsURL(contributionURL), monitor);
-        monitor.analyzeProblems();
-        if (metaDataURL != null) {
-            mergeContributionMetaData(metaDataURL, contribution);
-        }
-        installContribution(contribution, dependentContributionURIs, deployDeployables);
-    }
-
-    private void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException {
-        ContributionMetadata metaData;
-        Monitor monitor = deployer.createMonitor();
-        try {
-            metaData = deployer.loadXMLDocument(IOHelper.getLocationAsURL(metaDataURL), monitor);
-        } catch (Exception e) {
-            throw new ValidationException(e);
-        }
-        monitor.analyzeProblems();
-        contribution.getDeployables().addAll(metaData.getDeployables());
-        contribution.getImports().addAll(metaData.getImports());
-        contribution.getExports().addAll(metaData.getExports());
-    }
-    
-    public void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException {
-        // TODO: dependentContributionURIs
-        InstalledContribution ic = new InstalledContribution(contribution.getURI(), contribution.getLocation(), contribution);
-        installedContributions.put(contribution.getURI(), ic);
-        if (deployDeployables) {
-            for (Composite c : ic.getDefaultDeployables()) {
-                deployComposite(c, ic);
-            }
-        }
-    }
-
-    public String addDeploymentComposite(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException {
-        Monitor monitor = deployer.createMonitor();
-        Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
-        monitor.analyzeProblems();
-        return addDeploymentComposite(contributionURI, composite);
-    }
-
-    public String addDeploymentComposite(String contributionURI, Composite composite) throws ActivationException {
-        InstalledContribution ic = installedContributions.get(contributionURI);
-        if (ic == null) {
-            throw new IllegalArgumentException("contribution not installed: " + contributionURI);
-        }
-        String compositeArtifcatURI = deployer.attachDeploymentComposite(ic.getContribution(), composite, true);
-        deployComposite(composite, ic);
-        return compositeArtifcatURI;
-    }
-
-    public void addToDomainLevelComposite(String compositeURI) throws ActivationException {
-        String contributionURI = getContributionUriForArtifact(compositeURI);
-        InstalledContribution ic = installedContributions.get(contributionURI);
-        if (ic == null) {
-            throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
-        }
-        String relativeURI = compositeURI.substring(contributionURI.length()+1);
-        for (Artifact a : ic.getContribution().getArtifacts()) {
-            if (a.getURI().equals(relativeURI)) {
-                deployComposite((Composite) a.getModel(), ic);
-                return;
-            }
-        }
-        throw new IllegalArgumentException("composite not found: " + compositeURI);
-    }
-
-    public void removeFromDomainLevelComposite(String compositeURI) throws ActivationException {
-        String contributionURI = getContributionUriForArtifact(compositeURI);
-        InstalledContribution ic = installedContributions.get(contributionURI);
-        String relativeURI = compositeURI.substring(contributionURI.length()+1);
-        for (DeployedComposite dc : ic.getDeployedComposites()) {
-            if (relativeURI.equals(dc.getURI())) {
-                ic.getDeployedComposites().remove(dc);
-                dc.unDeploy();
-                return;
-            }
-        }
-        throw new IllegalStateException("composite not deployed: " + compositeURI);
-    }
-
-    public Composite getDomainLevelComposite() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public String getDomainLevelCompositeAsString() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public Object getQNameDefinition(String contributionURI, QName definition, QName symbolSpace) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public List<String> removeContribution(String contributionURI) throws ActivationException {
-        List<String> removedContributionURIs = new ArrayList<String>();
-        InstalledContribution ic = installedContributions.get(contributionURI);
-        if (ic != null) {
-            removedContributionURIs.add(ic.getURI());
-            for (String dependent : getDependentContributions(contributionURI)) {
-                removedContributionURIs.addAll(removeContribution(dependent));
-            }
-            installedContributions.remove(contributionURI);
-            for (DeployedComposite dc : ic.getDeployedComposites()) {
-                dc.unDeploy();
-            }
-            ic.getDeployedComposites().clear();
-        }
-        return removedContributionURIs;
-    }
-
-    public void updateContribution(String uri, String contributionURL) {
-        // TODO Auto-generated method stub
-        // is this just removeContribution/installContribution?
-    }
-    public void updateContribution(Contribution contribution) {
-        // TODO Auto-generated method stub
-    }
-
-    public String updateDeploymentComposite(String uri, Reader compositeXML) {
-        // TODO Auto-generated method stub
-        // is this removeFromDomainLevelComposite/addDeploymentComposite
-        return null;
-    }
-    public String updateDeploymentComposite(String uri, Composite composite) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public void shutdown() throws ActivationException {
-        for (String uri : installedContributions.keySet()) {
-            removeContribution(uri);
-        }
-    }
-
-    public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
-        try {
-            return SCAClientFactory.newInstance(URI.create(getDomainName())).getService(interfaze, serviceURI);
-        } catch (NoSuchDomainException e) {
-            // shouldn't ever happen as we know this is the domain so it must exist
-            throw new IllegalStateException(e);
-        }
-    }
-   
-    public String getDomainName() {
-        return domainName;
-    }
-
-    public List<String> getDeployedCompostes(String contributionURI) {
-        ArrayList<String> compositeURIs = new ArrayList<String>();
-        for (InstalledContribution ic : installedContributions.values()) {
-            for (DeployedComposite dc : ic.getDeployedComposites()) {
-                compositeURIs.add(ic.getURI() + "/" + dc.getURI());
-            }
-        }
-        return compositeURIs;
-    }
-
-    public List<String> getInstalledContributions() {
-        return new ArrayList<String>(installedContributions.keySet());
-    }
-
-    protected String getContributionUriForArtifact(String artifactURI) {
-        String contributionURI = null;
-        for (String uri : installedContributions.keySet()) {
-            if (artifactURI.startsWith(uri)) {
-                contributionURI = uri;
-                break;
-            }
-        }
-        if (contributionURI == null) {
-            throw new IllegalArgumentException("no contribution found for: " + artifactURI);
-        }
-        return contributionURI;
-    }
-
-    protected void deployComposite(Composite c, InstalledContribution ic) throws ActivationException {
-        List<Contribution> dependentContributions = new ArrayList<Contribution>();
-        for (InstalledContribution ics : installedContributions.values()) {
-            dependentContributions.add(ics.getContribution());
-        }
-
-        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
-        ic.getDeployedComposites().add(dc);
-    }
-    
-    public Set<String> getDependentContributions(String contributionURI) {
-        InstalledContribution ic = installedContributions.get(contributionURI);
-        if (ic == null) {
-            throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
-        }
-        Set<String> dependentContributionURIs = new HashSet<String>();
-        for (InstalledContribution icx : installedContributions.values()) {
-            if (ic != icx) {
-                List<Contribution> dependencies = icx.getContribution().getDependencies();
-                if (dependencies != null && dependencies.contains(ic.getContribution())) {
-                    dependentContributionURIs.addAll(getDependentContributions(icx.getURI()));
-                }
-            }
-        }
-        return dependentContributionURIs;
-    }
-
-    public Deployer getDeployer() {
-        return deployer;
-    }
-}
+/*
+ * 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.something.impl;
+
+import java.io.Reader;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.common.java.io.IOHelper;
+import org.apache.tuscany.sca.contribution.Artifact;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.ContributionMetadata;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.deployment.Deployer;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.apache.tuscany.sca.runtime.CompositeActivator;
+import org.apache.tuscany.sca.runtime.EndpointRegistry;
+import org.apache.tuscany.sca.something.Section10;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+import org.oasisopen.sca.client.SCAClientFactory;
+
+public class Section10Impl implements Section10 {
+
+    private String domainName;
+    private Deployer deployer;
+    private Map<String, InstalledContribution> installedContributions = new HashMap<String, InstalledContribution>();
+    private CompositeActivator compositeActivator;
+    private EndpointRegistry endpointRegistry;
+    private ExtensionPointRegistry extensionPointRegistry;
+    
+    public Section10Impl(String domainName, Deployer deployer, CompositeActivator compositeActivator, EndpointRegistry endpointRegistry, ExtensionPointRegistry extensionPointRegistry) {
+        this.domainName = domainName;
+        this.deployer = deployer;
+        this.compositeActivator = compositeActivator;
+        this.endpointRegistry = endpointRegistry;
+        this.extensionPointRegistry = extensionPointRegistry;
+    }
+
+    public void installContribution(String uri, String contributionURL, String metaDataURL, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException {
+        Monitor monitor = deployer.createMonitor();
+        Contribution contribution = deployer.loadContribution(URI.create(uri), IOHelper.getLocationAsURL(contributionURL), monitor);
+        monitor.analyzeProblems();
+        if (metaDataURL != null) {
+            mergeContributionMetaData(metaDataURL, contribution);
+        }
+        installContribution(contribution, dependentContributionURIs, deployDeployables);
+    }
+
+    private void mergeContributionMetaData(String metaDataURL, Contribution contribution) throws ValidationException {
+        ContributionMetadata metaData;
+        Monitor monitor = deployer.createMonitor();
+        try {
+            metaData = deployer.loadXMLDocument(IOHelper.getLocationAsURL(metaDataURL), monitor);
+        } catch (Exception e) {
+            throw new ValidationException(e);
+        }
+        monitor.analyzeProblems();
+        contribution.getDeployables().addAll(metaData.getDeployables());
+        contribution.getImports().addAll(metaData.getImports());
+        contribution.getExports().addAll(metaData.getExports());
+    }
+    
+    public void installContribution(Contribution contribution, List<String> dependentContributionURIs, boolean deployDeployables) throws ContributionReadException, ActivationException, ValidationException {
+        // TODO: dependentContributionURIs
+        InstalledContribution ic = new InstalledContribution(contribution.getURI(), contribution.getLocation(), contribution);
+        installedContributions.put(contribution.getURI(), ic);
+        if (deployDeployables) {
+            for (Composite c : ic.getDefaultDeployables()) {
+                deployComposite(c, ic);
+            }
+        }
+    }
+
+    public String addDeploymentComposite(String contributionURI, Reader compositeXML) throws ContributionReadException, XMLStreamException, ActivationException, ValidationException {
+        Monitor monitor = deployer.createMonitor();
+        Composite composite = deployer.loadXMLDocument(compositeXML, monitor);
+        monitor.analyzeProblems();
+        return addDeploymentComposite(contributionURI, composite);
+    }
+
+    public String addDeploymentComposite(String contributionURI, Composite composite) throws ActivationException {
+        InstalledContribution ic = installedContributions.get(contributionURI);
+        if (ic == null) {
+            throw new IllegalArgumentException("contribution not installed: " + contributionURI);
+        }
+        String compositeArtifcatURI = deployer.attachDeploymentComposite(ic.getContribution(), composite, true);
+        deployComposite(composite, ic);
+        return compositeArtifcatURI;
+    }
+
+    public void addToDomainLevelComposite(String compositeURI) throws ActivationException {
+        String contributionURI = getContributionUriForArtifact(compositeURI);
+        InstalledContribution ic = installedContributions.get(contributionURI);
+        if (ic == null) {
+            throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
+        }
+        String relativeURI = compositeURI.substring(contributionURI.length()+1);
+        for (Artifact a : ic.getContribution().getArtifacts()) {
+            if (a.getURI().equals(relativeURI)) {
+                deployComposite((Composite) a.getModel(), ic);
+                return;
+            }
+        }
+        throw new IllegalArgumentException("composite not found: " + compositeURI);
+    }
+
+    public void removeFromDomainLevelComposite(String compositeURI) throws ActivationException {
+        String contributionURI = getContributionUriForArtifact(compositeURI);
+        InstalledContribution ic = installedContributions.get(contributionURI);
+        String relativeURI = compositeURI.substring(contributionURI.length()+1);
+        for (DeployedComposite dc : ic.getDeployedComposites()) {
+            if (relativeURI.equals(dc.getURI())) {
+                ic.getDeployedComposites().remove(dc);
+                dc.unDeploy();
+                return;
+            }
+        }
+        throw new IllegalStateException("composite not deployed: " + compositeURI);
+    }
+
+    public Composite getDomainLevelComposite() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String getDomainLevelCompositeAsString() {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Object getQNameDefinition(String contributionURI, QName definition, QName symbolSpace) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public List<String> removeContribution(String contributionURI) throws ActivationException {
+        List<String> removedContributionURIs = new ArrayList<String>();
+        InstalledContribution ic = installedContributions.get(contributionURI);
+        if (ic != null) {
+            removedContributionURIs.add(ic.getURI());
+            for (String dependent : getDependentContributions(contributionURI)) {
+                removedContributionURIs.addAll(removeContribution(dependent));
+            }
+            installedContributions.remove(contributionURI);
+            for (DeployedComposite dc : ic.getDeployedComposites()) {
+                dc.unDeploy();
+            }
+            ic.getDeployedComposites().clear();
+        }
+        return removedContributionURIs;
+    }
+
+    public void updateContribution(String uri, String contributionURL) {
+        // TODO Auto-generated method stub
+        // is this just removeContribution/installContribution?
+    }
+    public void updateContribution(Contribution contribution) {
+        // TODO Auto-generated method stub
+    }
+
+    public String updateDeploymentComposite(String uri, Reader compositeXML) {
+        // TODO Auto-generated method stub
+        // is this removeFromDomainLevelComposite/addDeploymentComposite
+        return null;
+    }
+    public String updateDeploymentComposite(String uri, Composite composite) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public void shutdown() throws ActivationException {
+        for (String uri : installedContributions.keySet()) {
+            removeContribution(uri);
+        }
+    }
+
+    public <T> T getService(Class<T> interfaze, String serviceURI) throws NoSuchServiceException {
+        try {
+            return SCAClientFactory.newInstance(URI.create(getDomainName())).getService(interfaze, serviceURI);
+        } catch (NoSuchDomainException e) {
+            // shouldn't ever happen as we know this is the domain so it must exist
+            throw new IllegalStateException(e);
+        }
+    }
+   
+    public String getDomainName() {
+        return domainName;
+    }
+
+    public List<String> getDeployedCompostes(String contributionURI) {
+        ArrayList<String> compositeURIs = new ArrayList<String>();
+        for (InstalledContribution ic : installedContributions.values()) {
+            for (DeployedComposite dc : ic.getDeployedComposites()) {
+                compositeURIs.add(ic.getURI() + "/" + dc.getURI());
+            }
+        }
+        return compositeURIs;
+    }
+
+    public List<String> getInstalledContributions() {
+        return new ArrayList<String>(installedContributions.keySet());
+    }
+
+    protected String getContributionUriForArtifact(String artifactURI) {
+        String contributionURI = null;
+        for (String uri : installedContributions.keySet()) {
+            if (artifactURI.startsWith(uri)) {
+                contributionURI = uri;
+                break;
+            }
+        }
+        if (contributionURI == null) {
+            throw new IllegalArgumentException("no contribution found for: " + artifactURI);
+        }
+        return contributionURI;
+    }
+
+    protected void deployComposite(Composite c, InstalledContribution ic) throws ActivationException {
+        List<Contribution> dependentContributions = new ArrayList<Contribution>();
+        for (InstalledContribution ics : installedContributions.values()) {
+            dependentContributions.add(ics.getContribution());
+        }
+
+        DeployedComposite dc = new DeployedComposite(c, ic, dependentContributions, deployer, compositeActivator, endpointRegistry, extensionPointRegistry);
+        ic.getDeployedComposites().add(dc);
+    }
+    
+    public Set<String> getDependentContributions(String contributionURI) {
+        InstalledContribution ic = installedContributions.get(contributionURI);
+        if (ic == null) {
+            throw new IllegalArgumentException("Contribution not installed: " + contributionURI);
+        }
+        Set<String> dependentContributionURIs = new HashSet<String>();
+        for (InstalledContribution icx : installedContributions.values()) {
+            if (ic != icx) {
+                List<Contribution> dependencies = icx.getContribution().getDependencies();
+                if (dependencies != null && dependencies.contains(ic.getContribution())) {
+                    dependentContributionURIs.addAll(getDependentContributions(icx.getURI()));
+                }
+            }
+        }
+        return dependentContributionURIs;
+    }
+
+    public Deployer getDeployer() {
+        return deployer;
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/main/java/org/apache/tuscany/sca/something/impl/Section10Impl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java Sat Jun  5 05:17:47 2010
@@ -1,75 +1,75 @@
-/*
- * 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.something;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.assembly.Composite;
-import org.apache.tuscany.sca.contribution.Contribution;
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.deployment.Deployer;
-import org.apache.tuscany.sca.monitor.Monitor;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.apache.tuscany.sca.runtime.ActivationException;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-public class DeployerTestCase {
-
-    @Test
-    public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException {
-        Section10 section10 = Section10Factory.createSection10();
-        
-        Deployer deployer = section10.getDeployer();
-        Monitor monitor = deployer.createMonitor();
-        Contribution contribution = deployer.loadContribution(URI.create("foo"), new File("src/test/resources/sample-helloworld-nodeployable.jar").toURI().toURL(), monitor);
-        monitor.analyzeProblems();
-        
-        section10.installContribution(contribution, null, true);
-        List<String> ics = section10.getInstalledContributions();
-        Assert.assertEquals(1, ics.size());
-        Assert.assertEquals("foo", ics.get(0));
-    }
-
-    @Test
-    public void testAddDeploymentComposite() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException, XMLStreamException {
-        Section10 section10 = Section10Factory.createSection10();
-        
-        section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
-
-        Deployer deployer = section10.getDeployer();
-        Monitor monitor = deployer.createMonitor();
-        Composite composite = deployer.loadXMLDocument(new File("src/test/resources/helloworld2.composite").toURI().toURL(), monitor);
-        monitor.analyzeProblems();
-        composite.setURI("helloworld2.composite");
-        section10.addDeploymentComposite("foo", composite);
-        List<String> dcs = section10.getDeployedCompostes("foo");
-        Assert.assertEquals(1, dcs.size());
-        Assert.assertEquals("foo/helloworld2.composite", dcs.get(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.something;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.assembly.Composite;
+import org.apache.tuscany.sca.contribution.Contribution;
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.deployment.Deployer;
+import org.apache.tuscany.sca.monitor.Monitor;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class DeployerTestCase {
+
+    @Test
+    public void testInstalledContribution() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException {
+        Section10 section10 = Section10Factory.createSection10();
+        
+        Deployer deployer = section10.getDeployer();
+        Monitor monitor = deployer.createMonitor();
+        Contribution contribution = deployer.loadContribution(URI.create("foo"), new File("src/test/resources/sample-helloworld-nodeployable.jar").toURI().toURL(), monitor);
+        monitor.analyzeProblems();
+        
+        section10.installContribution(contribution, null, true);
+        List<String> ics = section10.getInstalledContributions();
+        Assert.assertEquals(1, ics.size());
+        Assert.assertEquals("foo", ics.get(0));
+    }
+
+    @Test
+    public void testAddDeploymentComposite() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException, MalformedURLException, XMLStreamException {
+        Section10 section10 = Section10Factory.createSection10();
+        
+        section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
+
+        Deployer deployer = section10.getDeployer();
+        Monitor monitor = deployer.createMonitor();
+        Composite composite = deployer.loadXMLDocument(new File("src/test/resources/helloworld2.composite").toURI().toURL(), monitor);
+        monitor.analyzeProblems();
+        composite.setURI("helloworld2.composite");
+        section10.addDeploymentComposite("foo", composite);
+        List<String> dcs = section10.getDeployedCompostes("foo");
+        Assert.assertEquals(1, dcs.size());
+        Assert.assertEquals("foo/helloworld2.composite", dcs.get(0));
+    }
+
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/DeployerTestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java Sat Jun  5 05:17:47 2010
@@ -1,114 +1,114 @@
-/*
- * 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.something;
-
-import java.net.MalformedURLException;
-import java.util.List;
-
-import junit.framework.Assert;
-
-import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
-import org.apache.tuscany.sca.monitor.ValidationException;
-import org.apache.tuscany.sca.runtime.ActivationException;
-import org.apache.tuscany.sca.something.impl.Section10Impl;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.oasisopen.sca.NoSuchDomainException;
-import org.oasisopen.sca.NoSuchServiceException;
-
-public class Section10TestCase {
-
-    @Test
-    public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);
-
-//        Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent");
-//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
-    }
-
-    @Ignore("TODO: fails with Sun JDK due to SCA properties issue")
-    @Test
-    public void testInstallWithDependent() throws NoSuchServiceException, ContributionReadException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("store", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store.jar", null, null, true);
-        section10.installContribution("store-client", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store-client.jar", null, null, true);
-
-//        Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent");
-//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
-    }
-
-    @Test
-    public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
-
-//        SCAClientFactory scaClientFactory = section10.getSCAClientFactory();
-//        try {
-//            scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
-//            Assert.fail();
-//        } catch (NoSuchServiceException e) {
-//            // expected as there is no deployables
-//        }
-
-        section10.addToDomainLevelComposite("helloworld" + "/helloworld.composite");
-//        Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
-//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
-    }
-
-    @Test
-    public void testGetInstalledContributions() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
-        List<String> ics = section10.getInstalledContributions();
-        Assert.assertEquals(1, ics.size());
-        Assert.assertEquals("foo", ics.get(0));
-    }
-
-    @Test
-    public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
-        List<String> dcs = section10.getDeployedCompostes("foo");
-        Assert.assertEquals(1, dcs.size());
-        Assert.assertEquals("foo/helloworld.composite", dcs.get(0));
-    }
-
-    @Test
-    public void testRemoveComposte() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
-        section10.removeFromDomainLevelComposite("foo/helloworld.composite");
-        List<String> dcs = section10.getDeployedCompostes("foo");
-        Assert.assertEquals(0, dcs.size());
-    }
-
-    @Test
-    public void testInstallWithMetaData() throws ContributionReadException, ActivationException, ValidationException {
-        Section10 section10 = Section10Factory.createSection10();
-        ((Section10Impl)section10).installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null, true);
-
-        List<String> dcs = section10.getDeployedCompostes("helloworld");
-        Assert.assertEquals(1, dcs.size());
-        Assert.assertEquals("helloworld/helloworld.composite", dcs.get(0));
-
-//        Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
-//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
-    }
-}
+/*
+ * 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.something;
+
+import java.net.MalformedURLException;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
+import org.apache.tuscany.sca.monitor.ValidationException;
+import org.apache.tuscany.sca.runtime.ActivationException;
+import org.apache.tuscany.sca.something.impl.Section10Impl;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.oasisopen.sca.NoSuchDomainException;
+import org.oasisopen.sca.NoSuchServiceException;
+
+public class Section10TestCase {
+
+    @Test
+    public void testInstallDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("helloworld", "src/test/resources/sample-helloworld.jar", null, null, true);
+
+//        Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent");
+//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
+    }
+
+    @Ignore("TODO: fails with Sun JDK due to SCA properties issue")
+    @Test
+    public void testInstallWithDependent() throws NoSuchServiceException, ContributionReadException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("store", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store.jar", null, null, true);
+        section10.installContribution("store-client", "/Tuscany/svn/2.x-trunk/itest/T3558/src/test/resources/sample-store-client.jar", null, null, true);
+
+//        Helloworld helloworldService = section10.getService(Helloworld.class, "HelloworldComponent");
+//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
+    }
+
+    @Test
+    public void testInstallNoDeployable() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
+
+//        SCAClientFactory scaClientFactory = section10.getSCAClientFactory();
+//        try {
+//            scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
+//            Assert.fail();
+//        } catch (NoSuchServiceException e) {
+//            // expected as there is no deployables
+//        }
+
+        section10.addToDomainLevelComposite("helloworld" + "/helloworld.composite");
+//        Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
+//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
+    }
+
+    @Test
+    public void testGetInstalledContributions() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("foo", "src/test/resources/sample-helloworld-nodeployable.jar", null, null, true);
+        List<String> ics = section10.getInstalledContributions();
+        Assert.assertEquals(1, ics.size());
+        Assert.assertEquals("foo", ics.get(0));
+    }
+
+    @Test
+    public void testGetDeployedCompostes() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
+        List<String> dcs = section10.getDeployedCompostes("foo");
+        Assert.assertEquals(1, dcs.size());
+        Assert.assertEquals("foo/helloworld.composite", dcs.get(0));
+    }
+
+    @Test
+    public void testRemoveComposte() throws NoSuchServiceException, NoSuchDomainException, ContributionReadException, MalformedURLException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        section10.installContribution("foo", "src/test/resources/sample-helloworld.jar", null, null, true);
+        section10.removeFromDomainLevelComposite("foo/helloworld.composite");
+        List<String> dcs = section10.getDeployedCompostes("foo");
+        Assert.assertEquals(0, dcs.size());
+    }
+
+    @Test
+    public void testInstallWithMetaData() throws ContributionReadException, ActivationException, ValidationException {
+        Section10 section10 = Section10Factory.createSection10();
+        ((Section10Impl)section10).installContribution("helloworld", "src/test/resources/sample-helloworld-nodeployable.jar", "src/test/resources/sca-contribution-generated.xml", null, true);
+
+        List<String> dcs = section10.getDeployedCompostes("helloworld");
+        Assert.assertEquals(1, dcs.size());
+        Assert.assertEquals("helloworld/helloworld.composite", dcs.get(0));
+
+//        Helloworld helloworldService = scaClientFactory.getService(Helloworld.class, "HelloworldComponent");
+//        Assert.assertEquals("Hello petra", helloworldService.sayHello("petra"));
+    }
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/org/apache/tuscany/sca/something/Section10TestCase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java Sat Jun  5 05:17:47 2010
@@ -1,24 +1,24 @@
-/*
- * 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 sample;
-
-public interface Helloworld {
-    String sayHello(String name);
-}
+/*
+ * 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 sample;
+
+public interface Helloworld {
+    String sayHello(String name);
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/java/sample/Helloworld.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/domain/src/test/resources/sca-contribution-generated.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/domain/src/test/resources/sca-contribution-generated.xml?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/domain/src/test/resources/sca-contribution-generated.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/domain/src/test/resources/sca-contribution-generated.xml Sat Jun  5 05:17:47 2010
@@ -1,23 +1,23 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.    
--->
-<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
-              xmlns:sample="http://sample">
-   <deployable composite="sample:helloworld"/>
-</contribution>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.    
+-->
+<contribution xmlns="http://docs.oasis-open.org/ns/opencsa/sca/200912"
+              xmlns:sample="http://sample">
+   <deployable composite="sample:helloworld"/>
+</contribution>

Propchange: tuscany/sca-java-2.x/trunk/modules/domain/src/test/resources/sca-contribution-generated.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/pom.xml?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/pom.xml Sat Jun  5 05:17:47 2010
@@ -1,45 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-modules</artifactId>
-        <version>2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
-    <name>Apache Tuscany SCA EndPoint Registry using Hazelcast Native Client</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.hazelcast</groupId>
-            <artifactId>hazelcast-client</artifactId>
-            <version>1.8.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-endpoint-hazelcast</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>compile</scope>
-        </dependency>
-    </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-modules</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>tuscany-endpoint-hazelcast-client</artifactId>
+    <name>Apache Tuscany SCA EndPoint Registry using Hazelcast Native Client</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hazelcast</groupId>
+            <artifactId>hazelcast-client</artifactId>
+            <version>1.8.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-endpoint-hazelcast</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java (original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java Sat Jun  5 05:17:47 2010
@@ -1,120 +1,120 @@
-/*
- * 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.endpoint.hazelcast.client;
-
-import java.net.BindException;
-import java.net.InetAddress;
-import java.net.NetworkInterface;
-import java.net.ServerSocket;
-import java.util.Enumeration;
-import java.util.Map;
-
-import org.apache.tuscany.sca.core.ExtensionPointRegistry;
-import org.apache.tuscany.sca.core.UtilityExtensionPoint;
-import org.apache.tuscany.sca.endpoint.hazelcast.HazelcastEndpointRegistry;
-import org.apache.tuscany.sca.endpoint.hazelcast.RegistryConfig;
-import org.apache.tuscany.sca.runtime.RuntimeProperties;
-
-import com.hazelcast.client.HazelcastClient;
-import com.hazelcast.core.HazelcastInstance;
-
-/**
- * An EndpointRegistry using a Hazelcast Native Client
- */
-public class HazelcastClientEndpointRegistry extends HazelcastEndpointRegistry {
-
-    HazelcastClient hazelcastClient;
-
-    public HazelcastClientEndpointRegistry(ExtensionPointRegistry registry,
-                                     Map<String, String> attributes,
-                                     String domainRegistryURI,
-                                     String domainURI) {
-        super(registry, attributes, domainRegistryURI, domainURI);
-    }
-
-    @Override
-    public void start() {
-        if (endpointMap != null) {
-            throw new IllegalStateException("The registry has already been started");
-        }
-        initHazelcastClientInstance();
-        endpointMap = hazelcastClient.getMap(domainURI + "/Endpoints");
-        endpointOwners = hazelcastClient.getMultiMap(domainURI + "/EndpointOwners");
-    }
-
-    @Override
-    public void stop() {
-        if (hazelcastClient != null) {
-            hazelcastClient.shutdown();
-            hazelcastClient = null;
-            endpointMap = null;
-        }
-    }
-
-    private void initHazelcastClientInstance() {
-        this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
-        RegistryConfig rc = new RegistryConfig(properties);
-        if (rc.getWKAs().size() < 1) {
-            String ip = getDefaultWKA();
-            if (ip != null) {
-                rc.getWKAs().add(ip);
-            }
-        }
-        if (rc.getWKAs().size() < 1) {
-            throw new IllegalArgumentException("Must specify remote IP address(es) for domain");
-        }
-        this.domainURI = properties.getProperty("defaultDomainName", "default");
-        this.hazelcastClient = HazelcastClient.newHazelcastClient(rc.getUserid(), rc.getPassword(), rc.getWKAs().toArray(new String[0]));
-    }
-
-    @Override
-    public HazelcastInstance getHazelcastInstance() {
-        return hazelcastClient;
-    }
-
-    /**
-     * See if there's a local IP listening on port 14820
-     */
-    protected static String getDefaultWKA() {
-        try {
-            Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
-            while (nis.hasMoreElements()) {
-                NetworkInterface ni = nis.nextElement();
-                Enumeration<InetAddress> ips = ni.getInetAddresses();
-                while (ips.hasMoreElements()) {
-                    InetAddress addr = ips.nextElement();
-                    ServerSocket ss = null;
-                    try {
-                        ss = new ServerSocket(14820, 0, addr);
-                    } catch (BindException e) {
-                        return addr.getHostAddress() + ":14820";
-                    } finally {
-                        if (ss != null) {
-                            ss.close();
-                        }
-                    }
-                }
-            }
-        } catch (Exception e) {
-        }
-        return null;
-    }    
-    
-}
+/*
+ * 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.endpoint.hazelcast.client;
+
+import java.net.BindException;
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.ServerSocket;
+import java.util.Enumeration;
+import java.util.Map;
+
+import org.apache.tuscany.sca.core.ExtensionPointRegistry;
+import org.apache.tuscany.sca.core.UtilityExtensionPoint;
+import org.apache.tuscany.sca.endpoint.hazelcast.HazelcastEndpointRegistry;
+import org.apache.tuscany.sca.endpoint.hazelcast.RegistryConfig;
+import org.apache.tuscany.sca.runtime.RuntimeProperties;
+
+import com.hazelcast.client.HazelcastClient;
+import com.hazelcast.core.HazelcastInstance;
+
+/**
+ * An EndpointRegistry using a Hazelcast Native Client
+ */
+public class HazelcastClientEndpointRegistry extends HazelcastEndpointRegistry {
+
+    HazelcastClient hazelcastClient;
+
+    public HazelcastClientEndpointRegistry(ExtensionPointRegistry registry,
+                                     Map<String, String> attributes,
+                                     String domainRegistryURI,
+                                     String domainURI) {
+        super(registry, attributes, domainRegistryURI, domainURI);
+    }
+
+    @Override
+    public void start() {
+        if (endpointMap != null) {
+            throw new IllegalStateException("The registry has already been started");
+        }
+        initHazelcastClientInstance();
+        endpointMap = hazelcastClient.getMap(domainURI + "/Endpoints");
+        endpointOwners = hazelcastClient.getMultiMap(domainURI + "/EndpointOwners");
+    }
+
+    @Override
+    public void stop() {
+        if (hazelcastClient != null) {
+            hazelcastClient.shutdown();
+            hazelcastClient = null;
+            endpointMap = null;
+        }
+    }
+
+    private void initHazelcastClientInstance() {
+        this.properties = registry.getExtensionPoint(UtilityExtensionPoint.class).getUtility(RuntimeProperties.class).getProperties();
+        RegistryConfig rc = new RegistryConfig(properties);
+        if (rc.getWKAs().size() < 1) {
+            String ip = getDefaultWKA();
+            if (ip != null) {
+                rc.getWKAs().add(ip);
+            }
+        }
+        if (rc.getWKAs().size() < 1) {
+            throw new IllegalArgumentException("Must specify remote IP address(es) for domain");
+        }
+        this.domainURI = properties.getProperty("defaultDomainName", "default");
+        this.hazelcastClient = HazelcastClient.newHazelcastClient(rc.getUserid(), rc.getPassword(), rc.getWKAs().toArray(new String[0]));
+    }
+
+    @Override
+    public HazelcastInstance getHazelcastInstance() {
+        return hazelcastClient;
+    }
+
+    /**
+     * See if there's a local IP listening on port 14820
+     */
+    protected static String getDefaultWKA() {
+        try {
+            Enumeration<NetworkInterface> nis = NetworkInterface.getNetworkInterfaces();
+            while (nis.hasMoreElements()) {
+                NetworkInterface ni = nis.nextElement();
+                Enumeration<InetAddress> ips = ni.getInetAddresses();
+                while (ips.hasMoreElements()) {
+                    InetAddress addr = ips.nextElement();
+                    ServerSocket ss = null;
+                    try {
+                        ss = new ServerSocket(14820, 0, addr);
+                    } catch (BindException e) {
+                        return addr.getHostAddress() + ":14820";
+                    } finally {
+                        if (ss != null) {
+                            ss.close();
+                        }
+                    }
+                }
+            }
+        } catch (Exception e) {
+        }
+        return null;
+    }    
+    
+}

Propchange: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast-client/src/main/java/org/apache/tuscany/sca/endpoint/hazelcast/client/HazelcastClientEndpointRegistry.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast/pom.xml?rev=951651&r1=951650&r2=951651&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast/pom.xml (original)
+++ tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast/pom.xml Sat Jun  5 05:17:47 2010
@@ -1,63 +1,63 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<project>
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.apache.tuscany.sca</groupId>
-        <artifactId>tuscany-modules</artifactId>
-        <version>2.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-    <artifactId>tuscany-endpoint-hazelcast</artifactId>
-    <name>Apache Tuscany SCA EndPoint Registry using Hazelcast</name>
-
-    <dependencies>
-        <dependency>
-            <groupId>com.hazelcast</groupId>
-            <artifactId>hazelcast</artifactId>
-            <version>1.8.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-core-spi</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>compile</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-core</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-deployment</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.tuscany.sca</groupId>
-            <artifactId>tuscany-implementation-java-runtime</artifactId>
-            <version>2.0-SNAPSHOT</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.tuscany.sca</groupId>
+        <artifactId>tuscany-modules</artifactId>
+        <version>2.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>tuscany-endpoint-hazelcast</artifactId>
+    <name>Apache Tuscany SCA EndPoint Registry using Hazelcast</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.hazelcast</groupId>
+            <artifactId>hazelcast</artifactId>
+            <version>1.8.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core-spi</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-core</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-deployment</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>2.0-SNAPSHOT</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+</project>

Propchange: tuscany/sca-java-2.x/trunk/modules/endpoint-hazelcast/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message