org.apache.tuscany.sca.contribution.processor
Class ExtensiblePackageProcessor

java.lang.Object
  extended by org.apache.tuscany.sca.contribution.processor.ExtensiblePackageProcessor
All Implemented Interfaces:
PackageProcessor

public class ExtensiblePackageProcessor
extends java.lang.Object
implements PackageProcessor

Implementation of an extensible package processor. Takes a package processor extension point and delegates to the proper package processor from the extension point based on the package's content type.


Constructor Summary
ExtensiblePackageProcessor(PackageProcessorExtensionPoint processors, TypeDescriber packageTypeDescriber, Monitor monitor)
           
 
Method Summary
protected  void error(java.lang.String message, java.lang.Object model, java.lang.Object... messageParameters)
          Marshals errors into the monitor
 java.util.List<java.net.URI> getArtifacts(java.net.URL packageSourceURL, java.io.InputStream inputStream)
          Returns a list of artifacts in the contribution.
 java.net.URL getArtifactURL(java.net.URL packageSourceURL, java.net.URI artifact)
          Return the URL for an artifact in the package.
 java.lang.String getPackageType()
          Returns the type of package supported by this package processor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtensiblePackageProcessor

public ExtensiblePackageProcessor(PackageProcessorExtensionPoint processors,
                                  TypeDescriber packageTypeDescriber,
                                  Monitor monitor)
Method Detail

error

protected void error(java.lang.String message,
                     java.lang.Object model,
                     java.lang.Object... messageParameters)
Marshals errors into the monitor

Parameters:
problems -
message -
model -

getArtifacts

public java.util.List<java.net.URI> getArtifacts(java.net.URL packageSourceURL,
                                                 java.io.InputStream inputStream)
                                          throws ContributionException,
                                                 java.io.IOException
Description copied from interface: PackageProcessor
Returns a list of artifacts in the contribution.

Specified by:
getArtifacts in interface PackageProcessor
Parameters:
packageSourceURL - Contribution package location URL
inputStream - Optional content of the package
Returns:
List of artifact URIs
Throws:
ContributionException
java.io.IOException

getArtifactURL

public java.net.URL getArtifactURL(java.net.URL packageSourceURL,
                                   java.net.URI artifact)
                            throws java.net.MalformedURLException
Description copied from interface: PackageProcessor
Return the URL for an artifact in the package. This is needed for archives such as jar files that have specific URL schemes for the artifacts they contain.

Specified by:
getArtifactURL in interface PackageProcessor
Parameters:
packageSourceURL - Contribution package location URL
artifact - The relative URI for the artifact
Returns:
The artifact URL
Throws:
java.net.MalformedURLException

getPackageType

public java.lang.String getPackageType()
Description copied from interface: PackageProcessor
Returns the type of package supported by this package processor.

Specified by:
getPackageType in interface PackageProcessor
Returns:
the package type