Author: rfeng
Date: Fri May  8 23:54:51 2009
New Revision: 773135

URL: http://svn.apache.org/viewvc?rev=773135&view=rev
Log:
Start to experiment a new way to provide the node configuration

Added:
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
    
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
    
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/
    
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/
    
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
    
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml

Added: 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java
 Fri May  8 23:54:51 2009
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Configuration for bindings used by an SCA node
+ */
+public interface BindingConfiguration {
+    /**
+     * Get the QName of the binding
+     * @return
+     */
+    QName getBindingType();
+
+    /**
+     *
+     * @param type
+     */
+    void setBindingType(QName type);
+
+    /**
+     * Get a list of base URIs for the binding. For each protocol supported by 
the binding,
+     * one base URI can be configured
+     * @return A list of base URIs
+     */
+    List<String> getBaseURIs();
+}

Added: 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java
 Fri May  8 23:54:51 2009
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+/**
+ * Configuration for an SCA contribution used by the SCA node
+ */
+public interface ContributionConfiguration {
+    /**
+     * Get the URI of the contribution
+     * @return The URI of the contribution
+     */
+    String getURI();
+
+    /**
+     * Set the URI of the contribution
+     * @param uri The URI of the contribution
+     */
+    void setURI(String uri);
+
+    /**
+     * Get the location of the contribution
+     * @return The location of the contribution
+     */
+    String getLocation();
+
+    /**
+     * Set the location of the contribution
+     * @param location The location of the contribution
+     */
+    void setLocation(String location);
+}

Added: 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java
 Fri May  8 23:54:51 2009
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+/**
+ * Configuration for a deployment composite
+ */
+public interface DeploymentComposite {
+    /**
+     * Get the location of the deployment composite, it can be relative to the 
owning
+     * contribution or an external resource
+     * @return
+     */
+    String getLocation();
+
+    /**
+     * Set the location of the deployment composite
+     * @param location
+     */
+    void setLocation(String location);
+
+    /**
+     * Get string content of the deployment composite (XML)
+     * @return
+     */
+    String getContent();
+
+    void setContent(String compositeXML);
+
+    /**
+     * Get the URI of the owning contribution
+     * @return
+     */
+    String getContributionURI();
+
+    /**
+     * Set the URI of the owning contribution
+     * @param contributionURI
+     */
+    void setContributionURI(String contributionURI);
+
+}

Added: 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java
 Fri May  8 23:54:51 2009
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+import java.util.List;
+
+/**
+ *
+ */
+public interface NodeConfiguration {
+    String getDomainURI();
+
+    void setDomainURI(String domainURI);
+
+    DeploymentComposite getDeploymentComposite();
+
+    void setDeploymentComposite(DeploymentComposite deploymentComposite);
+
+    List<ContributionConfiguration> getContributions();
+
+    List<BindingConfiguration> getBindings();
+}

Added: 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java
 Fri May  8 23:54:51 2009
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tuscany.sca.node.configuration;
+
+/**
+ * The factory to create java models related to the node configuration
+ */
+public interface NodeConfigurationFactory {
+    NodeConfiguration createNodeConfiguration();
+
+    ContributionConfiguration createContributionConfiguration();
+
+    BindingConfiguration createBindingConfiguration();
+
+    DeploymentComposite createDeploymentComposite();
+}

Added: 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml
 Fri May  8 23:54:51 2009
@@ -0,0 +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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903";
+    xmlns="http://tuscany.apache.org/xmlns/sca/1.1";
+    xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1";
+    targetNamespace="http://sample/node";
+    name="TestNode1"
+    domain="http://domain1";>
+
+    <!-- The deployment composite is optional -->
+    <!-- The deployment composite can be defined inline or referenced using a 
URI -->
+    <!-- Should we make it a child of contribution element? -->
+    <!-- Can we have more than one deployment composites -->
+    <deploymentComposite contribution="http://c2"; 
location="test/Test.composite">
+        <sca:composite>
+        </sca:composite>
+    </deploymentComposite>
+
+    <!-- Configure the base URIs for a given binding -->
+    <!-- Each base URI is for a protocol supported by the binding -->
+    <binding name="sca:binding.ws" baseURIs="http://localhost:8080/ws 
https://localhost:8081/ws";>
+    <binding name="tuscany:binding.rmi" baseURIs="rmi://localhost:8080/rmi">
+
+    <!-- Configure a list of contributions -->
+    <contribution uri="http://c1"; location="file:///a.jar"/>
+    <contribution uri="http://c2"; location="http://locahost/repo/b.jar"/>
+    <contribution uri="http://c3"; location="http://locahost/repo/c.jar"/>
+</node>
\ No newline at end of file

Added: 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml
URL: 
http://svn.apache.org/viewvc/tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml?rev=773135&view=auto
==============================================================================
--- 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml
 (added)
+++ 
tuscany/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml
 Fri May  8 23:54:51 2009
@@ -0,0 +1,34 @@
+<?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.
+-->
+<node xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200903";
+    xmlns="http://tuscany.apache.org/xmlns/sca/1.1";
+    xmlns:tuscany="http://tuscany.apache.org/xmlns/sca/1.1";
+    targetNamespace="http://sample/node";
+    name="TestNode2"
+    domain="http://domain1";
+    >
+    <deploymentComposite contribution="http://c1"; 
location="test/Test.composite">
+    </deploymentComposite>
+
+    <binding name="sca:binding.ws" baseURIs="http://localhost:8080/ws 
https://localhost:8081/ws";>
+    <binding name="tuscany:binding.rmi" baseURIs="rmi://localhost:8080/rmi">
+    <contribution uri="http://c1"; location="file:///a.jar"/>
+    <contribution uri="http://c4"; location="http://locahost/repo/d.jar"/>
+</node>
\ No newline at end of file


Reply via email to