You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2007/02/04 06:36:02 UTC
svn commit: r503358 - in /incubator/tuscany/java/sca/kernel:
core/src/main/java/org/apache/tuscany/core/services/deployment/
host-api/src/main/java/org/apache/tuscany/host/deployment/
spi/src/main/java/org/apache/tuscany/spi/deployer/
Author: rfeng
Date: Sat Feb 3 21:36:00 2007
New Revision: 503358
URL: http://svn.apache.org/viewvc?view=rev&rev=503358
Log:
Add methods in ContributionService to support artifact resolving
Modified:
incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java
incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java
Modified: incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java?view=diff&rev=503358&r1=503357&r2=503358
==============================================================================
--- incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java (original)
+++ incubator/tuscany/java/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java Sat Feb 3 21:36:00 2007
@@ -43,6 +43,10 @@
registry.put(processor.getContentType(), processor);
}
+ public void unregister(String contentType) {
+ registry.remove(contentType);
+ }
+
public URI contribute(URL contribution) throws DeploymentException, IOException {
if (contribution == null) {
throw new IllegalArgumentException("contribution is null");
@@ -85,6 +89,20 @@
throw new UnsupportedContentTypeException(contentType, source.toString());
}
+ return null;
+ }
+
+ public void remove(URI contribution) throws DeploymentException {
+ // TODO Auto-generated method stub
+ }
+
+ public <T> T resolve(URI contribution, Class<T> definitionType, String namespace, String name) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public URL resolve(URI contribution, String namespace, URI uri, URI baseURI) {
+ // TODO Auto-generated method stub
return null;
}
}
Modified: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java?view=diff&rev=503358&r1=503357&r2=503358
==============================================================================
--- incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java (original)
+++ incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java Sat Feb 3 21:36:00 2007
@@ -54,4 +54,41 @@
* @throws IOException if there was a problem reading the stream
*/
URI contribute(URI source, InputStream contribution, String contentType) throws DeploymentException, IOException;
+
+ /**
+ * 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);
}
Modified: incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java?view=diff&rev=503358&r1=503357&r2=503358
==============================================================================
--- incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java (original)
+++ incubator/tuscany/java/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/UnsupportedContentTypeException.java Sat Feb 3 21:36:00 2007
@@ -25,6 +25,7 @@
* @version $Rev$ $Date$
*/
public class UnsupportedContentTypeException extends DeploymentException {
+ private static final long serialVersionUID = -1831797280021355672L;
/**
* Constructor specifying the Content-Type value that is not supported.
Modified: incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java?view=diff&rev=503358&r1=503357&r2=503358
==============================================================================
--- incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java (original)
+++ incubator/tuscany/java/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContributionProcessorRegistry.java Sat Feb 3 21:36:00 2007
@@ -22,5 +22,15 @@
* @version $Rev$ $Date$
*/
public interface ContributionProcessorRegistry {
+ /**
+ * Register a ContributionProcessor using the content type as the key
+ * @param processor
+ */
void register(ContributionProcessor processor);
+
+ /**
+ * Unregister a ContributionProcessor by content type
+ * @param contentType
+ */
+ void unregister(String contentType);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org