summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/contribution-xml
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-25 23:40:38 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-03-25 23:40:38 +0000
commit1eafab3193550a62edf9a9c7c60c119796a9e7e8 (patch)
tree3b9da17022bb79565b4e24748ce8c34e87821cee /java/sca/modules/contribution-xml
parent6b71f86309fc1c20aaac34c205fe783664a48477 (diff)
Match the document using wildcards against the artifact URI
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@758464 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/contribution-xml')
-rw-r--r--java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java16
-rw-r--r--java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java28
-rw-r--r--java/sca/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor10
3 files changed, 27 insertions, 27 deletions
diff --git a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
index ff7bf7068a..0035f360ab 100644
--- a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
+++ b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionGeneratedMetadataDocumentProcessor.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.contribution.xml;
@@ -26,18 +26,18 @@ import org.apache.tuscany.sca.monitor.Monitor;
/**
* URLArtifactProcessor that handles sca-contribution-generated.xml files.
- *
+ *
* @version $Rev$ $Date$
*/
public class ContributionGeneratedMetadataDocumentProcessor extends ContributionMetadataDocumentProcessor {
- public ContributionGeneratedMetadataDocumentProcessor(XMLInputFactory inputFactory,
+ public ContributionGeneratedMetadataDocumentProcessor(XMLInputFactory inputFactory,
StAXArtifactProcessor staxProcessor,
Monitor monitor) {
super(inputFactory, staxProcessor, monitor);
}
-
- public ContributionGeneratedMetadataDocumentProcessor(FactoryExtensionPoint modelFactories,
+
+ public ContributionGeneratedMetadataDocumentProcessor(FactoryExtensionPoint modelFactories,
StAXArtifactProcessor staxProcessor,
Monitor monitor) {
super(modelFactories, staxProcessor, monitor);
@@ -45,6 +45,6 @@ public class ContributionGeneratedMetadataDocumentProcessor extends Contribution
@Override
public String getArtifactType() {
- return "sca-contribution-generated.xml";
+ return "/META-INF/sca-contribution-generated.xml";
}
}
diff --git a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
index f080f23797..d5fa606997 100644
--- a/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
+++ b/java/sca/modules/contribution-xml/src/main/java/org/apache/tuscany/sca/contribution/xml/ContributionMetadataDocumentProcessor.java
@@ -6,15 +6,15 @@
* 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.
+ * under the License.
*/
package org.apache.tuscany.sca.contribution.xml;
@@ -42,7 +42,7 @@ import org.apache.tuscany.sca.monitor.Problem.Severity;
/**
* URLArtifactProcessor that handles sca-contribution.xml files.
- *
+ *
* @version $Rev$ $Date$
*/
public class ContributionMetadataDocumentProcessor implements URLArtifactProcessor<ContributionMetadata>{
@@ -65,10 +65,10 @@ public class ContributionMetadataDocumentProcessor implements URLArtifactProcess
this.staxProcessor = staxProcessor;
this.monitor = monitor;
}
-
+
/**
* Report a exception.
- *
+ *
* @param problems
* @param message
* @param model
@@ -79,31 +79,31 @@ public class ContributionMetadataDocumentProcessor implements URLArtifactProcess
monitor.problem(problem);
}
}
-
+
public String getArtifactType() {
- return "sca-contribution.xml";
+ return "/META-INF/sca-contribution.xml";
}
-
+
public Class<ContributionMetadata> getModelType() {
return ContributionMetadata.class;
}
-
+
public ContributionMetadata read(URL contributionURL, URI uri, URL url) throws ContributionReadException {
InputStream urlStream = null;
try {
-
+
// Create a stream reader
URLConnection connection = url.openConnection();
connection.setUseCaches(false);
urlStream = connection.getInputStream();
XMLStreamReader reader = inputFactory.createXMLStreamReader(url.toString(), urlStream);
reader.nextTag();
-
+
// Read the contribution model
ContributionMetadata contribution = (ContributionMetadata)staxProcessor.read(reader);
return contribution;
-
+
} catch (XMLStreamException e) {
ContributionReadException ex = new ContributionReadException(e);
error("XMLStreamException", inputFactory, ex);
@@ -123,7 +123,7 @@ public class ContributionMetadataDocumentProcessor implements URLArtifactProcess
}
}
}
-
+
public void resolve(ContributionMetadata contribution, ModelResolver resolver) throws ContributionResolveException {
staxProcessor.resolve(contribution, resolver);
}
diff --git a/java/sca/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor b/java/sca/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
index 23adab56b9..cdaca4d786 100644
--- a/java/sca/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
+++ b/java/sca/modules/contribution-xml/src/main/resources/META-INF/services/org.apache.tuscany.sca.contribution.processor.URLArtifactProcessor
@@ -5,16 +5,16 @@
# 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.
+# under the License.
# Implementation class for the artifact processor extension
-org.apache.tuscany.sca.contribution.xml.ContributionMetadataDocumentProcessor;type=sca-contribution.xml,model=org.apache.tuscany.sca.contribution.ContributionMetadata
-org.apache.tuscany.sca.contribution.xml.ContributionGeneratedMetadataDocumentProcessor;type=sca-contribution-generated.xml
+org.apache.tuscany.sca.contribution.xml.ContributionMetadataDocumentProcessor;type=/META-INF/sca-contribution.xml,model=org.apache.tuscany.sca.contribution.ContributionMetadata
+org.apache.tuscany.sca.contribution.xml.ContributionGeneratedMetadataDocumentProcessor;type=/META-INF/sca-contribution-generated.xml