From 4d42c3077b596356b97d0c917e0bd69f7a8360ae Mon Sep 17 00:00:00 2001 From: rfeng Date: Fri, 8 May 2009 23:54:51 +0000 Subject: Start to experiment a new way to provide the node configuration git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@773135 13f79535-47bb-0310-9956-ffa450edef68 --- .../node/configuration/BindingConfiguration.java | 48 ++++++++++++++++++ .../configuration/ContributionConfiguration.java | 49 ++++++++++++++++++ .../node/configuration/DeploymentComposite.java | 59 ++++++++++++++++++++++ .../sca/node/configuration/NodeConfiguration.java | 39 ++++++++++++++ .../configuration/NodeConfigurationFactory.java | 33 ++++++++++++ .../tuscany/sca/node/configuration/node1.xml | 45 +++++++++++++++++ .../tuscany/sca/node/configuration/node2.xml | 34 +++++++++++++ 7 files changed, 307 insertions(+) create mode 100644 java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java create mode 100644 java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java create mode 100644 java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java create mode 100644 java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java create mode 100644 java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java create mode 100644 java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml create mode 100644 java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml (limited to 'java/sca/modules/implementation-node') diff --git a/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java new file mode 100644 index 0000000000..ecd6ec513f --- /dev/null +++ b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/BindingConfiguration.java @@ -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 getBaseURIs(); +} diff --git a/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java new file mode 100644 index 0000000000..a408ae0716 --- /dev/null +++ b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/ContributionConfiguration.java @@ -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); +} diff --git a/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java new file mode 100644 index 0000000000..d94c70a759 --- /dev/null +++ b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/DeploymentComposite.java @@ -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); + +} diff --git a/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java new file mode 100644 index 0000000000..bd1d9aebb0 --- /dev/null +++ b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfiguration.java @@ -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 getContributions(); + + List getBindings(); +} diff --git a/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java new file mode 100644 index 0000000000..e20fef27c1 --- /dev/null +++ b/java/sca/modules/implementation-node/src/main/java/org/apache/tuscany/sca/node/configuration/NodeConfigurationFactory.java @@ -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(); +} diff --git a/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml b/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml new file mode 100644 index 0000000000..cba4ef378b --- /dev/null +++ b/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node1.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml b/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml new file mode 100644 index 0000000000..ae47e70cc1 --- /dev/null +++ b/java/sca/modules/implementation-node/src/test/resources/org/apache/tuscany/sca/node/configuration/node2.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + \ No newline at end of file -- cgit v1.2.3