diff options
author | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
---|---|---|
committer | dims <dims@13f79535-47bb-0310-9956-ffa450edef68> | 2008-06-17 00:23:01 +0000 |
commit | bdd0a41aed7edf21ec2a65cfa17a86af2ef8c48a (patch) | |
tree | 38a92061c0793434c4be189f1d70c3458b6bc41d /branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java |
Move Tuscany from Incubator to top level.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@668359 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java')
-rw-r--r-- | branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java | 120 |
1 files changed, 120 insertions, 0 deletions
diff --git a/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java b/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java new file mode 100644 index 0000000000..307d6e36dc --- /dev/null +++ b/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java @@ -0,0 +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.host.deployment; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URL; + +/** + * Service interface that manages artifacts contributed to a Tuscany runtime. + * + * @version $Rev$ $Date$ + */ +public interface ContributionService { + /** + * Contribute an artifact to the SCA Domain. The type of the contribution is + * determined by the Content-Type of the resource or, if that is undefined, + * by some implementation-specific means (such as mapping an extension in + * the URL's path). + * + * @param contributionURI The URI that is used as the contribution unique ID. + * @param sourceURL the location of the resource containing the artifact + * @param storeInRepository flag that identifies if you want to copy the + * contribution to the repository + * @throws DeploymentException if there was a problem with the contribution + * @throws IOException if there was a problem reading the resource + */ + void contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws DeploymentException, + IOException; + + /** + * Contribute an artifact to the SCA Domain. + * + * @param contributionURI The URI that is used as the contribution unique ID. + * @param contributionContent a stream containing the resource being + * contributed; the stream will not be closed but the read + * position after the call is undefined + * @throws DeploymentException if there was a problem with the contribution + * @throws IOException if there was a problem reading the stream + */ + void contribute(URI contributionURI, InputStream contributionContent) + throws DeploymentException, IOException; + + /** + * Get the model for an installed contribution + * + * @param contribution The URI of an installed contribution + * @return The model for the contribution or null if there is no such + * contribution + */ + Object getContribution(URI contribution); + + /** + * Adds or updates a deployment composite using a supplied composite + * ("composite by value" – a data structure, not an existing resource in the + * domain) to the contribution identified by a supplied contribution URI. + * The added or updated deployment composite is given a relative URI that + * matches the "name" attribute of the composite, with a ".composite" + * suffix. + */ + void addDeploymentComposite(URI contribution, Object composite); + + /** + * Remove a contribution from the SCA domain + * + * @param contribution The URI of the contribution + * @throws DeploymentException + */ + void remove(URI contribution) throws DeploymentException; + + /** + * Resolve an artifact by QName within the contribution + * + * @param <T> The java type of the artifact such as javax.wsdl.Definition + * @param contribution The URI of the contribution + * @param definitionType The java type of the artifact + * @param namespace The namespace of the artifact + * @param name The name of the artifact + * @return The resolved artifact + */ + <T> T resolve(URI contribution, Class<T> definitionType, String namespace, String name); + + /** + * Resolve the reference to an artifact by the location URI within the given + * contribution. Some typical use cases are: + * <ul> + * <li>Reference a XML schema using + * {http://www.w3.org/2001/XMLSchema-instance}schemaLocation or + * <li>Reference a list of WSDLs using + * {http://www.w3.org/2004/08/wsdl-instance}wsdlLocation + * </ul> + * + * @param contribution The URI of the contribution + * @param namespace The namespace of the artifact. This is for validation + * purpose. If the namespace is null, then no check will be + * performed. + * @param uri The location URI + * @param baseURI The URI of the base artifact where the reference is + * declared + * @return The URL of the resolved artifact + */ + URL resolve(URI contribution, String namespace, URI uri, URI baseURI); +} |