org.jboss.shrinkwrap.api.container
Interface ManifestContainer<T extends Archive<T>>

Type Parameters:
T -
All Known Subinterfaces:
EnterpriseArchive, JavaArchive, ResourceAdapterArchive, ServiceProviderContainer<T>, WebArchive

public interface ManifestContainer<T extends Archive<T>>

Defines the contract for a component capable of storing Manifest related resources.

The actual path to the Manifest resources within the Archive is up to the implementations/specifications.

Version:
$Revision: $
Author:
Aslak Knutsen

Field Summary
static String DEFAULT_MANIFEST_NAME
           
 
Method Summary
 T addAsManifestResource(Asset resource, ArchivePath target)
          Adds the Asset as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(Asset resource, String target)
          Adds the Asset as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(File resource)
          Adds the File as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(File resource, ArchivePath target)
          Adds the File as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(File resource, String target)
          Adds the File as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(Package resourcePackage, String resourceName)
          Adds the resource as a resource to the container, returning the container itself.
 T addAsManifestResource(Package resourcePackage, String resourceName, ArchivePath target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsManifestResource(Package resourcePackage, String resourceName, String target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsManifestResource(String resourceName)
          Adds the resource as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(String resourceName, ArchivePath target)
          Adds the resource as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(String resourceName, String target)
          Adds the resource as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(URL resource, ArchivePath target)
          Adds the URL as a Manifest resource to the container, returning the container itself.
 T addAsManifestResource(URL resource, String target)
          Adds the URL as a Manifest resource to the container, returning the container itself.
 T addAsManifestResources(Package resourcePackage, String... resourceNames)
          Adds the resources inside the package as multiple resources to the container, returning the container itself.
 T addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls)
          Adds a META-INF/services/ServiceInterfaceName Asset representing this service.
 T addManifest()
          Adds a default generated MANIFEST.MF manifest to the current archive.
 T setManifest(Asset resource)
          Adds the Asset as MANIFEST.FM to the container, returning the container itself.
 T setManifest(File resource)
          Adds the File as MANIFEST.FM to the container, returning the container itself.
 T setManifest(Package resourcePackage, String resourceName)
          Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.
 T setManifest(String resourceName)
          Adds the resource as MANIFEST.FM to the container, returning the container itself.
 T setManifest(URL resource)
          Adds the URL as MANIFEST.FM to the container, returning the container itself.
 

Field Detail

DEFAULT_MANIFEST_NAME

static final String DEFAULT_MANIFEST_NAME
See Also:
Constant Field Values
Method Detail

setManifest

T setManifest(String resourceName)
                                 throws IllegalArgumentException
Adds the resource as MANIFEST.FM to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
setManifest(Asset)

setManifest

T setManifest(File resource)
                                 throws IllegalArgumentException
Adds the File as MANIFEST.FM to the container, returning the container itself.

Parameters:
resource - File resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
setManifest(Asset)

setManifest

T setManifest(URL resource)
                                 throws IllegalArgumentException
Adds the URL as MANIFEST.FM to the container, returning the container itself.

Parameters:
resource - URL resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
setManifest(Asset)

setManifest

T setManifest(Asset resource)
                                 throws IllegalArgumentException
Adds the Asset as MANIFEST.FM to the container, returning the container itself.

Parameters:
resource - File resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
addAsManifestResource(Asset, ArchivePath)

setManifest

T setManifest(Package resourcePackage,
              String resourceName)
                                 throws IllegalArgumentException
Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null

addAsManifestResource

T addAsManifestResource(String resourceName)
                                           throws IllegalArgumentException
Adds the resource as a Manifest resource to the container, returning the container itself.
The resource will be placed into the Container Manifest path under the same context from which it was retrieved.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null

addAsManifestResource

T addAsManifestResource(File resource)
                                           throws IllegalArgumentException
Adds the File as a Manifest resource to the container, returning the container itself.
The File will be placed into the Container Manifest path under File.getName().

Parameters:
resource - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if File resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(String resourceName,
                        String target)
                                           throws IllegalArgumentException
Adds the resource as a Manifest resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(File resource,
                        String target)
                                           throws IllegalArgumentException
Adds the File as a Manifest resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(URL resource,
                        String target)
                                           throws IllegalArgumentException
Adds the URL as a Manifest resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(Asset resource,
                        String target)
                                           throws IllegalArgumentException
Adds the Asset as a Manifest resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(String resourceName,
                        ArchivePath target)
                                           throws IllegalArgumentException
Adds the resource as a Manifest resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(File resource,
                        ArchivePath target)
                                           throws IllegalArgumentException
Adds the File as a Manifest resource to the container, returning the container itself.

Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(URL resource,
                        ArchivePath target)
                                           throws IllegalArgumentException
Adds the URL as a Manifest resource to the container, returning the container itself.

Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addAsManifestResource(Asset, ArchivePath)

addAsManifestResource

T addAsManifestResource(Asset resource,
                        ArchivePath target)
                                           throws IllegalArgumentException
Adds the Asset as a Manifest resource to the container, returning the container itself.

Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives manifest path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null

addAsManifestResources

T addAsManifestResources(Package resourcePackage,
                         String... resourceNames)
                                            throws IllegalArgumentException
Adds the resources inside the package as multiple resources to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resources
resourceNames - The names of the resources inside resoucePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if no resourceNames are specified or containing null

addAsManifestResource

T addAsManifestResource(Package resourcePackage,
                        String resourceName)
                                           throws IllegalArgumentException
Adds the resource as a resource to the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null

addAsManifestResource

T addAsManifestResource(Package resourcePackage,
                        String resourceName,
                        String target)
                                           throws IllegalArgumentException
Adds the resource as a resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null

addAsManifestResource

T addAsManifestResource(Package resourcePackage,
                        String resourceName,
                        ArchivePath target)
                                           throws IllegalArgumentException
Adds the resource as a resource to a specific path inside the container, returning the container itself.

The ClassLoader used to obtain the resource is up to the implementation.

Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null

addAsServiceProvider

T addAsServiceProvider(Class<?> serviceInterface,
                       Class<?>... serviceImpls)
                                          throws IllegalArgumentException
Adds a META-INF/services/ServiceInterfaceName Asset representing this service. Warning: this method does not add the specified classes to the archive.

Parameters:
serviceInterface - The Service Interface class
serviceImpls - The Service Interface Implementations
Returns:
This virtual archive
Throws:
IllegalArgumentException - if serviceInterface is null
IllegalArgumentException - if serviceImpls is null or contain null values

addManifest

T addManifest()
                                 throws IllegalArgumentException
Adds a default generated MANIFEST.MF manifest to the current archive.

Returns:
This virtual archive
Throws:
IllegalArgumentException - if serviceInterface is null


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.