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

All Known Subinterfaces:
EnterpriseArchive, ResourceAdapterArchive, WebArchive

public interface LibraryContainer<T extends Archive<T>>

LibraryContainer Defines the contract for a component capable of storing Libraries.

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

Version:
$Revision: $
Author:
Aslak Knutsen

Method Summary
 T addLibraries(Archive<?>... archives)
          Add multiple Archives to this Archive as libraries to the container, returning the container itself.
 T addLibraries(File... resources)
          Add multiple File to this Archive as libraries to the container, returning the container itself.
 T addLibraries(String... resourceNames)
          Add multiple resources to this Archive as libraries to the container, returning the container itself.
 T addLibrary(Archive<?> archive)
          Add another Archive to this Archive as a library to the container, returning the container itself.
 T addLibrary(Asset resource, ArchivePath target)
          Adds the Asset as a library to the container, returning the container itself.
 T addLibrary(Asset resource, String target)
          Adds the Asset as a library to the container, returning the container itself.
 T addLibrary(File resource)
          Adds the File as a library to the container, returning the container itself.
 T addLibrary(File resource, ArchivePath target)
          Adds the File as a library to the container, returning the container itself.
 T addLibrary(File resource, String target)
          Adds the File as a library to the container, returning the container itself.
 T addLibrary(String resourceName)
          Adds the resource as a library to the container, returning the container itself.
 T addLibrary(String resourceName, ArchivePath target)
          Adds the resource as a library to the container, returning the container itself.
 T addLibrary(String resourceName, String target)
          Adds the resource as a library to the container, returning the container itself.
 T addLibrary(URL resource, ArchivePath target)
          Adds the URL as a library to the container, returning the container itself.
 T addLibrary(URL resource, String target)
          Adds the URL as a library to the container, returning the container itself.
 

Method Detail

addLibrary

T addLibrary(String resourceName)
                                throws IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.
The resource will be placed into the Container Library 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
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

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

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

addLibrary

T addLibrary(String resourceName,
             String target)
                                throws IllegalArgumentException
Adds the resource as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

T addLibrary(File resource,
             String target)
                                throws IllegalArgumentException
Adds the File as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

T addLibrary(URL resource,
             String target)
                                throws IllegalArgumentException
Adds the URL as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

T addLibrary(Asset resource,
             String target)
                                throws IllegalArgumentException
Adds the Asset as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

T addLibrary(String resourceName,
             ArchivePath target)
                                throws IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.

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

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

addLibrary

T addLibrary(File resource,
             ArchivePath target)
                                throws IllegalArgumentException
Adds the File as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

T addLibrary(URL resource,
             ArchivePath target)
                                throws IllegalArgumentException
Adds the URL as a library 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 library path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
IllegalArgumentException - if target is null
See Also:
addLibrary(Asset, ArchivePath)

addLibrary

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

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

addLibrary

T addLibrary(Archive<?> archive)
                                throws IllegalArgumentException
Add another Archive to this Archive as a library to the container, returning the container itself.
The Archive will be placed into the Container Library path under Archive.getName().

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

addLibraries

T addLibraries(String... resourceNames)
                                  throws IllegalArgumentException
Add multiple resources to this Archive as libraries to the container, returning the container itself.
The resources will be placed into the Container Library path under the same context from which they were retrieved.

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

Parameters:
resourceNames - resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceNames are null or empty
See Also:
addLibrary(String)

addLibraries

T addLibraries(File... resources)
                                  throws IllegalArgumentException
Add multiple File to this Archive as libraries to the container, returning the container itself.
The Files will be placed into the Container Library path under File.getName().

Parameters:
resourceNames - File resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if File resources are null or empty
See Also:
addLibrary(File)

addLibraries

T addLibraries(Archive<?>... archives)
                                  throws IllegalArgumentException
Add multiple Archives to this Archive as libraries to the container, returning the container itself.
The Archives will be placed into the Container Library path under Archive.getName().

Parameters:
archive - Archive resources to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if Archive resources are null
See Also:
addLibrary(Archive)


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