You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2007/03/09 04:27:32 UTC
svn commit: r516277 - in
/incubator/tuscany/branches/sca-java-integration/sca/kernel:
core/src/main/java/org/apache/tuscany/core/services/deployment/
core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/
core/src/main/resources/o...
Author: lresende
Date: Thu Mar 8 19:27:30 2007
New Revision: 516277
URL: http://svn.apache.org/viewvc?view=rev&rev=516277
Log:
[sca-integration-branch] Integration of sca-contribution.xml while scanning contributions
Added:
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java
- copied, changed from r515706, incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/ScdlContributionProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java
Removed:
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/ScdlContributionProcessor.java
Modified:
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java
incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImpl.java Thu Mar 8 19:27:30 2007
@@ -26,7 +26,9 @@
import java.util.Map;
import org.apache.tuscany.core.util.FileHelper;
+import org.apache.tuscany.spi.deployer.ContentType;
import org.apache.tuscany.spi.deployer.ContentTypeDescriber;
+import org.apache.tuscany.spi.model.Contribution;
import org.osoa.sca.annotations.EagerInit;
import org.osoa.sca.annotations.Service;
@@ -50,11 +52,10 @@
* extensions
*/
private void init() {
- contentTypeRegistry.put("SCDL", "application/vnd.tuscany.scdl");
- contentTypeRegistry.put("COMPOSITE", "application/vnd.tuscany.scdl");
- contentTypeRegistry.put("WSDL", "application/vnd.tuscany.wsdl");
- contentTypeRegistry.put("JAR", "application/x-compressed");
- contentTypeRegistry.put("FOLDER", "application/vnd.tuscany.folder");
+ contentTypeRegistry.put("COMPOSITE", ContentType.COMPOSITE);
+ contentTypeRegistry.put("SCDL", ContentType.COMPOSITE);
+ contentTypeRegistry.put("WSDL", ContentType.WSDL);
+ contentTypeRegistry.put("JAR", ContentType.JAR);
}
protected String resolveContentyTypeByExtension(URL resourceURL) {
@@ -80,7 +81,12 @@
String contentType = defaultContentType;
if (resourceURL.getProtocol().equals("file") && FileHelper.toFile(resourceURL).isDirectory()) {
- contentType = this.contentTypeRegistry.get("FOLDER");
+ // Special case : contribution is a folder
+ contentType = ContentType.FOLDER;
+ } else if (resourceURL.toExternalForm().endsWith(Contribution.SCA_CONTRIBUTION_META)
+ || resourceURL.toExternalForm().endsWith(Contribution.SCA_CONTRIBUTION_GENERATED_META)) {
+ // Special case : contribution metadata
+ contentType = ContentType.CONTRIBUTION_METADATA;
} else {
contentType = resolveContentyTypeByExtension(resourceURL);
if (contentType == null) {
@@ -89,7 +95,7 @@
contentType = connection.getContentType();
if (contentType == null || contentType.equals("content/unknown")) {
- // here we couldn't figure out from our registry or from URL
+ // here we couldn't figure out from our registry or from URL and it's not a special file
// return defaultContentType if provided
contentType = defaultContentType;
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionProcessorRegistryImpl.java Thu Mar 8 19:27:30 2007
@@ -84,7 +84,6 @@
}
processor.processContent(contribution, source, inputStream);
-
}
public void processModel(Contribution contribution, URI source, Object modelObject) throws DeploymentException,
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/ContributionServiceImpl.java Thu Mar 8 19:27:30 2007
@@ -20,12 +20,16 @@
import java.io.IOException;
import java.io.InputStream;
-import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
+import java.net.URLClassLoader;
import java.util.HashMap;
import java.util.Map;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
import org.apache.tuscany.core.util.IOHelper;
import org.apache.tuscany.host.deployment.ContributionService;
import org.apache.tuscany.host.deployment.DeploymentException;
@@ -33,6 +37,7 @@
import org.apache.tuscany.spi.deployer.ArtifactResolverRegistry;
import org.apache.tuscany.spi.deployer.ContributionProcessorRegistry;
import org.apache.tuscany.spi.deployer.ContributionRepository;
+import org.apache.tuscany.spi.loader.LoaderException;
import org.apache.tuscany.spi.model.CompositeComponentType;
import org.apache.tuscany.spi.model.Contribution;
import org.apache.tuscany.spi.model.DeployedArtifact;
@@ -52,6 +57,16 @@
protected ContributionProcessorRegistry processorRegistry;
/**
+ * xml factory used to create reader instance to load contribution metadata
+ */
+ protected XMLInputFactory xmlFactory;
+ /**
+ * contribution metadata loader
+ */
+ protected ContributionLoader contributionLoader;
+
+
+ /**
* Contribution registry This is a registry of processed Contributios index
* by URI
*/
@@ -67,48 +82,119 @@
this.contributionRepository = repository;
this.processorRegistry = processorRegistry;
this.resolverRegistry = resolverRegistry;
+
+ this.xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", getClass().getClassLoader());
+ this.contributionLoader = new ContributionLoader(null);
}
public void contribute(URI contributionURI, URL sourceURL, boolean storeInRepository) throws DeploymentException,
IOException {
+ if (contributionURI == null) {
+ throw new IllegalArgumentException("URI for the contribution is null");
+ }
if (sourceURL == null) {
throw new IllegalArgumentException("Source URL for the contribution is null");
}
- Contribution contribution = new Contribution(contributionURI);
- contribution.setLocation(sourceURL);
- InputStream is = IOHelper.getInputStream(sourceURL);
- try {
- addContribution(contribution, is, storeInRepository);
- } finally {
- IOHelper.closeQuietly(is);
- }
+ addContribution(contributionURI, sourceURL, null, storeInRepository);
}
public void contribute(URI contributionURI, InputStream input) throws DeploymentException, IOException {
- Contribution contribution = new Contribution(contributionURI);
- addContribution(contribution, input, true);
+ addContribution(contributionURI, null, input, true);
}
- private void addContribution(Contribution contribution, InputStream contributionStream, boolean storeInRepository)
- throws IOException, MalformedURLException, DeploymentException {
- if (contributionStream == null && contribution.getLocation() == null) {
+ private Contribution initializeContributionMetadata(URL sourceURL) throws DeploymentException {
+ Contribution contributionMetadata = null;
+ URL contributionMetadataURL;
+ URL generatedContributionMetadataURL;
+ InputStream metadataStream = null;
+
+ URL[] clUrls = {sourceURL};
+ URLClassLoader cl = new URLClassLoader(clUrls, getClass().getClassLoader());
+
+ contributionMetadataURL = cl.getResource(Contribution.SCA_CONTRIBUTION_META);
+ generatedContributionMetadataURL = cl.getResource(Contribution.SCA_CONTRIBUTION_GENERATED_META);
+
+ try {
+ if (contributionMetadataURL == null && generatedContributionMetadataURL == null) {
+ contributionMetadata = new Contribution();
+ } else {
+ URL metadataURL =
+ contributionMetadataURL != null ? contributionMetadataURL : generatedContributionMetadataURL;
+
+ try {
+ metadataStream = metadataURL.openStream();
+ XMLStreamReader xmlReader = this.xmlFactory.createXMLStreamReader(metadataStream);
+ contributionMetadata = this.contributionLoader.load(null, null, xmlReader, null);
+
+ } catch (IOException ioe) {
+ throw new
+ InvalidContributionMetadataException(ioe.getMessage(), metadataURL.toExternalForm(), ioe);
+ } catch (XMLStreamException xmle) {
+ throw new
+ InvalidContributionMetadataException(xmle.getMessage(), metadataURL.toExternalForm(), xmle);
+ } catch (LoaderException le) {
+ throw new
+ InvalidContributionMetadataException(le.getMessage(), metadataURL.toExternalForm(), le);
+ }
+ }
+ } finally {
+ IOHelper.closeQuietly(metadataStream);
+ metadataStream = null;
+ }
+
+ if (contributionMetadata == null) {
+ contributionMetadata = new Contribution();
+ }
+
+ return contributionMetadata;
+
+ }
+
+ /**
+ * Note:
+ * @param contributionURI ContributionID
+ * @param sourceURL contribution location
+ * @param contributionStream contribution content
+ * @param storeInRepository flag if we store the contribution into the repository or not
+ * @throws IOException
+ * @throws DeploymentException
+ */
+ private void addContribution(URI contributionURI, URL sourceURL, InputStream contributionStream, boolean storeInRepository)
+ throws IOException, DeploymentException {
+ if (contributionStream == null && sourceURL == null) {
throw new IllegalArgumentException("The content of the contribution is null");
}
// store the contribution in the contribution repository
- if (storeInRepository) {
- URL locationURL = null;
- if (contribution.getLocation() != null) {
- locationURL = contributionRepository.store(contribution.getUri(), contribution.getLocation());
+ URL locationURL = sourceURL;
+ if (contributionRepository != null && storeInRepository) {
+ if (sourceURL != null) {
+ locationURL = contributionRepository.store(contributionURI, sourceURL);
} else {
- locationURL = contributionRepository.store(contribution.getUri(), contributionStream);
+ locationURL = contributionRepository.store(contributionURI, contributionStream);
}
- contribution.setLocation(locationURL);
}
- // process the contribution
- this.processorRegistry.processContent(contribution, contribution.getUri(), contributionStream);
+ Contribution contribution = initializeContributionMetadata(locationURL);
+ contribution.setURI(contributionURI);
+ contribution.setLocation(locationURL);
+
+ if (contributionStream == null) {
+ contributionStream = sourceURL.openStream();
+ try {
+ // process the contribution
+ this.processorRegistry.processContent(contribution, contribution.getUri(), contributionStream);
+ } finally {
+ IOHelper.closeQuietly(contributionStream);
+ contributionStream = null;
+ }
+
+ } else {
+ // process the contribution
+ this.processorRegistry.processContent(contribution, contribution.getUri(), contributionStream);
+ }
+
// store the contribution on the registry
this.contributionRegistry.put(contribution.getUri(), contribution);
Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java?view=auto&rev=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/InvalidContributionMetadataException.java Thu Mar 8 19:27:30 2007
@@ -0,0 +1,52 @@
+/*
+ * 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.core.services.deployment;
+
+import org.apache.tuscany.host.deployment.DeploymentException;
+
+/**
+ * Exception that indicates that the supplied XML Document invalid.
+ *
+ * @version $Rev: 511466 $ $Date: 2007-02-25 00:45:22 -0800 (Sun, 25 Feb 2007) $
+ */
+public class InvalidContributionMetadataException extends DeploymentException {
+
+ protected InvalidContributionMetadataException() {
+ }
+
+ protected InvalidContributionMetadataException(String message) {
+ super(message);
+ }
+
+ protected InvalidContributionMetadataException(String message, String identifier) {
+ super(message, identifier);
+ }
+
+ protected InvalidContributionMetadataException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ protected InvalidContributionMetadataException(String message, String identifier, Throwable cause) {
+ super(message, identifier, cause);
+ }
+
+ protected InvalidContributionMetadataException(Throwable cause) {
+ super(cause);
+ }
+}
Copied: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java (from r515706, incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/ScdlContributionProcessor.java)
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java?view=diff&rev=516277&p1=incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/ScdlContributionProcessor.java&r1=515706&p2=incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/ScdlContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessor.java Thu Mar 8 19:27:30 2007
@@ -29,6 +29,7 @@
import org.apache.tuscany.host.deployment.DeploymentException;
import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.deployer.CompositeClassLoader;
+import org.apache.tuscany.spi.deployer.ContentType;
import org.apache.tuscany.spi.deployer.ContributionProcessor;
import org.apache.tuscany.spi.deployer.DeploymentContext;
import org.apache.tuscany.spi.extension.ContributionProcessorExtension;
@@ -39,13 +40,16 @@
import org.apache.tuscany.spi.model.CompositeImplementation;
import org.apache.tuscany.spi.model.Contribution;
-public class ScdlContributionProcessor extends ContributionProcessorExtension implements ContributionProcessor {
- public static final String CONTENT_TYPE = "application/vnd.tuscany.scdl";
+public class CompositeContributionProcessor extends ContributionProcessorExtension implements ContributionProcessor {
+ /**
+ * Content-type that this processor can handle
+ */
+ public static final String CONTENT_TYPE = ContentType.COMPOSITE;
protected XMLInputFactory xmlFactory;
private final LoaderRegistry registry;
- public ScdlContributionProcessor(@Autowire LoaderRegistry registry) {
+ public CompositeContributionProcessor(@Autowire LoaderRegistry registry) {
super();
this.registry = registry;
this.xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", getClass().getClassLoader());
@@ -56,9 +60,9 @@
return CONTENT_TYPE;
}
- public void processContent(Contribution contribution, URI source, InputStream inputStream)
+ public void processContent(Contribution contribution, URI artifactURI, InputStream inputStream)
throws DeploymentException, IOException {
- if (source == null) {
+ if (artifactURI == null) {
throw new IllegalArgumentException("Invalid null source uri.");
}
@@ -70,10 +74,11 @@
CompositeClassLoader cl = new CompositeClassLoader(getClass().getClassLoader());
cl.addURL(contribution.getLocation());
DeploymentContext deploymentContext = new RootDeploymentContext(cl, this.xmlFactory, null,
- contribution.getArtifact(source).getLocation());
+ contribution.getArtifact(artifactURI).getLocation());
CompositeComponentType componentType = this.registry.load(null, null,
- contribution.getArtifact(source).getLocation(), CompositeComponentType.class, deploymentContext);
+ contribution.getArtifact(artifactURI).getLocation(),
+ CompositeComponentType.class, deploymentContext);
CompositeImplementation implementation = new CompositeImplementation();
implementation.setComponentType(componentType);
@@ -82,10 +87,10 @@
componentDefinition.setName(componentType.getName());
- contribution.getArtifact(source).addModelObject(CompositeComponentType.class, null, componentDefinition);
+ contribution.getArtifact(artifactURI).addModelObject(CompositeComponentType.class, null, componentDefinition);
} catch (LoaderException le) {
- throw new InvalidComponentDefinitionlException(contribution.getArtifact(source).getLocation()
+ throw new InvalidComponentDefinitionlException(contribution.getArtifact(artifactURI).getLocation()
.toExternalForm(), le);
}
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/FolderContributionProcessor.java Thu Mar 8 19:27:30 2007
@@ -32,6 +32,7 @@
import org.apache.tuscany.core.util.FileHelper;
import org.apache.tuscany.core.util.IOHelper;
import org.apache.tuscany.host.deployment.DeploymentException;
+import org.apache.tuscany.spi.deployer.ContentType;
import org.apache.tuscany.spi.deployer.ContentTypeDescriber;
import org.apache.tuscany.spi.deployer.ContributionProcessor;
import org.apache.tuscany.spi.extension.ContributionProcessorExtension;
@@ -39,7 +40,10 @@
import org.apache.tuscany.spi.model.DeployedArtifact;
public class FolderContributionProcessor extends ContributionProcessorExtension implements ContributionProcessor {
- public static final String CONTENT_TYPE = "application/vnd.tuscany.folder";
+ /**
+ * Content-type that this processor can handle
+ */
+ public static final String CONTENT_TYPE = ContentType.FOLDER;
@Override
public String getContentType() {
@@ -111,19 +115,17 @@
artifact.setLocation(artifactURL);
contribution.addArtifact(artifact);
- // TODO: remove this... for debug purpose only
ContentTypeDescriber contentTypeDescriber = new ContentTypeDescriberImpl();
String contentType = contentTypeDescriber.getContentType(artifactURL, null);
- // System.out.println("File : " + artifactURL);
- // System.out.println("Type : " + contentType);
- // just process scdl for now
- if ("application/vnd.tuscany.scdl".equals(contentType)) {
+ // just process scdl and contribution metadata for now
+ if (ContentType.COMPOSITE.equals(contentType)) {
InputStream is = artifactURL.openStream();
try {
this.registry.processContent(contribution, artifactURI, is);
} finally {
IOHelper.closeQuietly(is);
+ is = null;
}
}
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JarContributionProcessor.java Thu Mar 8 19:27:30 2007
@@ -32,6 +32,7 @@
import org.apache.tuscany.core.services.deployment.ContentTypeDescriberImpl;
import org.apache.tuscany.core.util.IOHelper;
import org.apache.tuscany.host.deployment.DeploymentException;
+import org.apache.tuscany.spi.deployer.ContentType;
import org.apache.tuscany.spi.deployer.ContentTypeDescriber;
import org.apache.tuscany.spi.deployer.ContributionProcessor;
import org.apache.tuscany.spi.extension.ContributionProcessorExtension;
@@ -39,7 +40,10 @@
import org.apache.tuscany.spi.model.DeployedArtifact;
public class JarContributionProcessor extends ContributionProcessorExtension implements ContributionProcessor {
- public static final String CONTENT_TYPE = "application/x-compressed";
+ /**
+ * Content-type that this processor can handle
+ */
+ public static final String CONTENT_TYPE = ContentType.JAR;
@Override
public String getContentType() {
@@ -115,20 +119,18 @@
artifact.setLocation(artifactURL);
contribution.addArtifact(artifact);
- // TODO: remove this... for debug purpose only
+
ContentTypeDescriber contentTypeDescriber = new ContentTypeDescriberImpl();
String contentType = contentTypeDescriber.getContentType(artifactURL, null);
- // System.out.println("File : " + artifactURL);
- // System.out.println("Type : " + contentType);
// just process scdl for now
- if ("application/vnd.tuscany.scdl".equals(contentType)
- /* || "application/java-vm".equals(contentType) */) {
+ if (ContentType.COMPOSITE.equals(contentType)) {
InputStream is = IOHelper.getInputStream(artifactURL);
try {
this.registry.processContent(contribution, artifactURI, artifactURL.openStream());
} finally {
IOHelper.closeQuietly(is);
+ is = null;
}
}
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessor.java Thu Mar 8 19:27:30 2007
@@ -27,6 +27,7 @@
import org.apache.tuscany.host.deployment.DeploymentException;
import org.apache.tuscany.spi.annotation.Autowire;
import org.apache.tuscany.spi.deployer.CompositeClassLoader;
+import org.apache.tuscany.spi.deployer.ContentType;
import org.apache.tuscany.spi.deployer.ContributionProcessor;
import org.apache.tuscany.spi.extension.ContributionProcessorExtension;
import org.apache.tuscany.spi.implementation.java.IntrospectionRegistry;
@@ -40,7 +41,7 @@
/**
* Content-type that this processor can handle
*/
- public static final String CONTENT_TYPE = "application/java-vm";
+ public static final String CONTENT_TYPE = ContentType.JAVA;
/**
* Pojo introspector
*/
@@ -67,9 +68,9 @@
return clazzName;
}
- public void processContent(Contribution contribution, URI source, InputStream inputStream)
+ public void processContent(Contribution contribution, URI artifactURI, InputStream inputStream)
throws DeploymentException, IOException {
- if (source == null) {
+ if (artifactURI == null) {
throw new IllegalArgumentException("Invalid null source uri.");
}
@@ -81,20 +82,20 @@
CompositeClassLoader cl = new CompositeClassLoader(getClass().getClassLoader());
cl.addURL(contribution.getLocation());
- String clazzName = getClazzName(contribution.getArtifact(source).getLocation());
+ String clazzName = getClazzName(contribution.getArtifact(artifactURI).getLocation());
System.out.println(clazzName);
Class clazz = cl.loadClass(clazzName);
PojoComponentType javaInfo = introspector.introspect(null, clazz, null, null);
- contribution.getArtifact(source).addModelObject(PojoComponentType.class, null, javaInfo);
+ contribution.getArtifact(artifactURI).addModelObject(PojoComponentType.class, null, javaInfo);
} catch (ClassNotFoundException cnfe) {
- throw new InvalidPojoComponentDefinitionlException(contribution.getArtifact(source).getLocation()
+ throw new InvalidPojoComponentDefinitionlException(contribution.getArtifact(artifactURI).getLocation()
.toExternalForm(), cnfe);
} catch (ProcessingException pe) {
- throw new InvalidPojoComponentDefinitionlException(contribution.getArtifact(source).getLocation()
+ throw new InvalidPojoComponentDefinitionlException(contribution.getArtifact(artifactURI).getLocation()
.toExternalForm(), pe);
}
}
Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java?view=auto&rev=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/java/org/apache/tuscany/core/services/deployment/contribution/MetadataContributionProcessor.java Thu Mar 8 19:27:30 2007
@@ -0,0 +1,90 @@
+/*
+ * 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.core.services.deployment.contribution;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.tuscany.core.services.deployment.ContributionLoader;
+import org.apache.tuscany.host.deployment.DeploymentException;
+import org.apache.tuscany.spi.deployer.ContentType;
+import org.apache.tuscany.spi.deployer.ContributionProcessor;
+import org.apache.tuscany.spi.extension.ContributionProcessorExtension;
+import org.apache.tuscany.spi.loader.LoaderException;
+import org.apache.tuscany.spi.model.Contribution;
+
+public class MetadataContributionProcessor extends ContributionProcessorExtension implements ContributionProcessor {
+ /**
+ * Content-type that this processor can handle
+ */
+ public static final String CONTENT_TYPE = ContentType.CONTRIBUTION_METADATA;
+
+ protected XMLInputFactory xmlFactory;
+ protected ContributionLoader contributionLoader;
+
+ public MetadataContributionProcessor() {
+ super();
+ this.xmlFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory", getClass().getClassLoader());
+ this.contributionLoader = new ContributionLoader(null);
+ }
+
+ @Override
+ public String getContentType() {
+ return CONTENT_TYPE;
+ }
+
+ public void processContent(Contribution contribution, URI artifactURI, InputStream inputStream)
+ throws DeploymentException, IOException {
+ if (artifactURI == null) {
+ throw new IllegalArgumentException("Invalid null source uri.");
+ }
+
+ if (inputStream == null) {
+ throw new IllegalArgumentException("Invalid null source inputstream.");
+ }
+
+ try {
+ XMLStreamReader xmlReader = this.xmlFactory.createXMLStreamReader(inputStream);
+ Contribution contributionMetadata = this.contributionLoader.load(null, null, xmlReader, null);
+
+ for (QName deployable : contributionMetadata.getDeployables()) {
+ System.out.println("Deployable : " + deployable.toString());
+ }
+
+ } catch (XMLStreamException xmle) {
+ throw new InvalidComponentDefinitionlException(contribution.getArtifact(artifactURI).getLocation()
+ .toExternalForm(), xmle);
+ } catch (LoaderException le){
+ throw new InvalidComponentDefinitionlException(contribution.getArtifact(artifactURI).getLocation()
+ .toExternalForm(), le);
+ }
+ }
+
+ public void processModel(Contribution contribution, URI source, Object modelObject) throws DeploymentException,
+ IOException {
+ }
+
+}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/main/resources/org/apache/tuscany/core/deployment.scdl Thu Mar 8 19:27:30 2007
@@ -54,10 +54,10 @@
<component name="JavaContributionProcessor" initLevel="30">
<system:implementation.system class="org.apache.tuscany.core.services.deployment.contribution.JavaContributionProcessor" />
</component>
- <component name="ScdlContributionProcessor" initLevel="30">
- <system:implementation.system class="org.apache.tuscany.core.services.deployment.contribution.ScdlContributionProcessor" />
- </component>
-
+ <component name="CompositeContributionProcessor" initLevel="30">
+ <system:implementation.system class="org.apache.tuscany.core.services.deployment.contribution.CompositeContributionProcessor" />
+ </component>
+
<!-- contribution resolver registry and resolvers -->
<component name="artifactResolverRegistry" initLevel="35">
<system:implementation.system class="org.apache.tuscany.core.services.deployment.ArtifactResolverRegistryImpl" />
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/ContentTypeDescriberImplTestCase.java Thu Mar 8 19:27:30 2007
@@ -22,12 +22,14 @@
import junit.framework.TestCase;
+import org.apache.tuscany.spi.deployer.ContentType;
+
public class ContentTypeDescriberImplTestCase extends TestCase {
private ContentTypeDescriberImpl contentTypeBuilder;
public void testResolveContentType() throws Exception {
URL artifactURL = getClass().getResource("test.scdl");
- assertEquals("application/vnd.tuscany.scdl", contentTypeBuilder.getContentType(artifactURL, null));
+ assertEquals(ContentType.COMPOSITE, contentTypeBuilder.getContentType(artifactURL, null));
}
Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java?view=auto&rev=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/CompositeContributionProcessorTestCase.java Thu Mar 8 19:27:30 2007
@@ -0,0 +1,84 @@
+/*
+ * 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.core.services.deployment.contribution;
+
+import java.net.URL;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.tuscany.core.idl.java.JavaInterfaceProcessorRegistryImpl;
+import org.apache.tuscany.core.implementation.IntrospectionRegistryImpl;
+import org.apache.tuscany.core.implementation.processor.DestroyProcessor;
+import org.apache.tuscany.core.implementation.processor.ImplementationProcessorServiceImpl;
+import org.apache.tuscany.core.implementation.processor.InitProcessor;
+import org.apache.tuscany.core.implementation.processor.PropertyProcessor;
+import org.apache.tuscany.core.implementation.processor.ReferenceProcessor;
+import org.apache.tuscany.core.implementation.processor.ResourceProcessor;
+import org.apache.tuscany.core.implementation.processor.ScopeProcessor;
+import org.apache.tuscany.core.monitor.NullMonitorFactory;
+import org.apache.tuscany.spi.deployer.ContributionProcessor;
+import org.apache.tuscany.spi.implementation.java.ImplementationProcessorService;
+
+public class CompositeContributionProcessorTestCase extends TestCase {
+ private static final String CONTRIBUTION = "/repository/sample-calculator.jar";
+ private static final String ARTIFACT_URL = "/META-INF/sca/default.scdl";
+ private IntrospectionRegistryImpl registry;
+
+ protected void setUp() throws Exception {
+ super.setUp();
+ registry = new IntrospectionRegistryImpl();
+ registry.setMonitor(new NullMonitorFactory().getMonitor(IntrospectionRegistryImpl.Monitor.class));
+ registry.registerProcessor(new DestroyProcessor());
+ registry.registerProcessor(new InitProcessor());
+ registry.registerProcessor(new ScopeProcessor());
+ JavaInterfaceProcessorRegistryImpl interfaceProcessorRegistry = new JavaInterfaceProcessorRegistryImpl();
+ ImplementationProcessorService service = new ImplementationProcessorServiceImpl(interfaceProcessorRegistry);
+ registry.registerProcessor(new PropertyProcessor(service));
+ registry.registerProcessor(new ReferenceProcessor(interfaceProcessorRegistry));
+ registry.registerProcessor(new ResourceProcessor());
+ }
+
+ protected URL getArtifactURL() throws Exception {
+ URL jarURL = getClass().getResource(CONTRIBUTION);
+ JarInputStream jar = new JarInputStream(getClass().getResourceAsStream(CONTRIBUTION));
+ URL rootURL = new URL("jar:" + jarURL.toString() + "!/");
+ URL classURL = null;
+
+ try {
+ while (true) {
+ JarEntry entry = jar.getNextJarEntry();
+ if (entry.getName().endsWith(".class")) {
+ classURL = new URL(rootURL, entry.getName());
+ break;
+ }
+ }
+ } finally {
+ jar.close();
+ }
+ return classURL;
+ }
+
+ public final void testProcessScdl() throws Exception {
+ //ContributionProcessor scdlContributionProcessor = new scdlContributionProcessor(registry);
+ //URL jarURL = this.getClassURL();
+ //javaContributionProcessor.processContent(null, jarURL, jarURL.openStream());
+ }
+}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/core/src/test/java/org/apache/tuscany/core/services/deployment/contribution/JavaContributionProcessorTestCase.java Thu Mar 8 19:27:30 2007
@@ -18,9 +18,8 @@
*/
package org.apache.tuscany.core.services.deployment.contribution;
+import java.net.URI;
import java.net.URL;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
import junit.framework.TestCase;
@@ -34,13 +33,17 @@
import org.apache.tuscany.core.implementation.processor.ResourceProcessor;
import org.apache.tuscany.core.implementation.processor.ScopeProcessor;
import org.apache.tuscany.core.monitor.NullMonitorFactory;
+import org.apache.tuscany.spi.deployer.ContributionProcessor;
import org.apache.tuscany.spi.implementation.java.ImplementationProcessorService;
+import org.apache.tuscany.spi.model.Contribution;
+import org.apache.tuscany.spi.model.DeployedArtifact;
public class JavaContributionProcessorTestCase extends TestCase {
- private static final String JAR_CONTRIBUTION = "/repository/sample-calculator.jar";
- private static final String JAVA_ARTIFACT_URL
- = "jar:file://repository/sample-calculator.jar!/calculator/AddService.class";
+ private static final String CONTRIBUTION = "/repository/sample-calculator.jar";
+ private static final String JAVA_ARTIFACT = "calculator/AddService.class";
private IntrospectionRegistryImpl registry;
+ private URI contributionId;
+ private Contribution contribution;
protected void setUp() throws Exception {
super.setUp();
@@ -54,32 +57,23 @@
registry.registerProcessor(new PropertyProcessor(service));
registry.registerProcessor(new ReferenceProcessor(interfaceProcessorRegistry));
registry.registerProcessor(new ResourceProcessor());
+
+ contributionId = new URI("sca://contribution/001");
+ contribution = new Contribution(contributionId);
+ contribution.setLocation(getClass().getResource(CONTRIBUTION));
+
+ DeployedArtifact classArtifact = new DeployedArtifact(contributionId);
+ classArtifact.setLocation(this.getArtifactURL());
}
- protected URL getClassURL() throws Exception {
- URL jarURL = getClass().getResource(JAR_CONTRIBUTION);
- JarInputStream jar = new JarInputStream(getClass().getResourceAsStream(JAR_CONTRIBUTION));
- URL rootURL = new URL("jar:" + jarURL.toString() + "!/");
- URL classURL = null;
-
- try {
- while (true) {
- JarEntry entry = jar.getNextJarEntry();
- if (entry.getName().endsWith(".class")) {
- classURL = new URL(rootURL, entry.getName());
- break;
- }
- }
- } finally {
- jar.close();
- }
- return classURL;
+ protected URL getArtifactURL() throws Exception {
+ URL jarURL = getClass().getResource(CONTRIBUTION);
+ return new URL("jar:" + jarURL.toString() + "!/" + JAVA_ARTIFACT);
}
- public final void testProcessJarArtifacts() throws Exception {
+ public final void testProcessJavaArtifact() throws Exception {
//ContributionProcessor javaContributionProcessor = new JavaContributionProcessor(registry);
-
- //URL jarURL = this.getClassURL();
- //javaContributionProcessor.processContent(null, jarURL, jarURL.openStream());
+ //URL artifactURL = this.getArtifactURL();
+ //javaContributionProcessor.processContent(contribution, artifactURL.toURI(), artifactURL.openStream());
}
}
Modified: incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java?view=diff&rev=516277&r1=516276&r2=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java (original)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/host-api/src/main/java/org/apache/tuscany/host/deployment/ContributionService.java Thu Mar 8 19:27:30 2007
@@ -35,7 +35,7 @@
* by some implementation-specific means (such as mapping an extension in
* the URL's path).
*
- * @param contributionURI The URI of the contribution
+ * @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
@@ -48,7 +48,7 @@
/**
* Contribute an artifact to the SCA Domain.
*
- * @param contributionURI an identifier for the source of this contribution
+ * @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
Added: incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java?view=auto&rev=516277
==============================================================================
--- incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java (added)
+++ incubator/tuscany/branches/sca-java-integration/sca/kernel/spi/src/main/java/org/apache/tuscany/spi/deployer/ContentType.java Thu Mar 8 19:27:30 2007
@@ -0,0 +1,37 @@
+/*
+ * 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.spi.deployer;
+
+public interface ContentType {
+ /**
+ * Archive specific content types
+ */
+ public static final String JAR = "application/x-compressed";
+ public static final String FOLDER = "application/vnd.tuscany.folder";
+
+ /**
+ * Artifact/File specific content types
+ */
+ public static final String CONTRIBUTION_METADATA = "application/vnd.tuscany.contribution.metadata";
+ public static final String COMPOSITE = "application/vnd.tuscany.composite";
+ public static final String WSDL = "application/vnd.tuscany.wsdl";
+ public static final String JAVA = "application/java-vm";
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org