ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

org.jboss.shrinkwrap.impl.base.container
Class WebContainerBase<T extends Archive<T>>

java.lang.Object
  extended by org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
      extended by org.jboss.shrinkwrap.impl.base.container.ContainerBase<T>
          extended by org.jboss.shrinkwrap.impl.base.container.WebContainerBase<T>
Type Parameters:
T -
All Implemented Interfaces:
Archive<T>, Assignable, ClassContainer<T>, LibraryContainer<T>, ManifestContainer<T>, ResourceContainer<T>, ServiceProviderContainer<T>, WebContainer<T>, ArchiveFormatAssociable
Direct Known Subclasses:
WebArchiveImpl

public abstract class WebContainerBase<T extends Archive<T>>
extends ContainerBase<T>
implements WebContainer<T>

WebContainerBase Abstract class that helps implement the WebContainer. Used by specs that extends the WebContainer.

Version:
$Revision: $
Author:
Aslak Knutsen

Field Summary
 
Fields inherited from interface org.jboss.shrinkwrap.api.container.ManifestContainer
DEFAULT_MANIFEST_NAME
 
Constructor Summary
protected WebContainerBase(Class<T> actualType, Archive<?> archive)
           
 
Method Summary
 T addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls)
          Adds a META-INF/services/ServiceInterfaceName Asset representing this service.
 T addAsServiceProviderAndClasses(Class<?> serviceInterface, Class<?>... serviceImpls)
          Adds a META-INF/services/ServiceInterfaceName Asset and the classes related to the service to the archive.
 T addAsWebInfResource(Asset resource, ArchivePath target)
          Adds the Asset as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Asset resource, String target)
          Adds the Asset as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource, ArchivePath target)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(File resource, String target)
          Adds the File as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName, ArchivePath target)
          Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
 T addAsWebInfResource(Package resourcePackage, String resourceName, String target)
          Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.
 T addAsWebInfResource(String resourceName)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(String resourceName, ArchivePath target)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(String resourceName, String target)
          Adds the resource as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(URL resource, ArchivePath target)
          Adds the URL as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResource(URL resource, String target)
          Adds the URL as a WEB-INF resource to the container, returning the container itself.
 T addAsWebInfResources(Package resourcePackage, String... resourceNames)
          Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.
 T addAsWebResource(Asset resource, ArchivePath target)
          Adds the Asset as a Web resource to the container, returning the container itself.
 T addAsWebResource(Asset resource, String target)
          Adds the Asset as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource, ArchivePath target)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(File resource, String target)
          Adds the File as a Web resource to the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName)
          Adds the resource as a resource to the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName, ArchivePath target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsWebResource(Package resourcePackage, String resourceName, String target)
          Adds the resource as a resource to a specific path inside the container, returning the container itself.
 T addAsWebResource(String resourceName)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(String resourceName, ArchivePath target)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(String resourceName, String target)
          Adds the resource as a Web resource to the container, returning the container itself.
 T addAsWebResource(URL resource, ArchivePath target)
          Adds the URL as a Web resource to the container, returning the container itself.
 T addAsWebResource(URL resource, String target)
          Adds the URL as a Web resource to the container, returning the container itself.
 T addAsWebResources(Package resourcePackage, String... resourceNames)
          Adds the resources inside the package as multiple resources to the container, returning the container itself.
protected abstract  ArchivePath getServiceProvidersPath()
          Returns the path to web container service providers
protected abstract  ArchivePath getWebInfPath()
          Returns the path to WEB-INF
protected abstract  ArchivePath getWebPath()
          Returns the path to web resources
 T setWebXML(Asset resource)
          Adds the Asset as web.xml to the container, returning the container itself.
 T setWebXML(File resource)
          Adds the File as web.xml to the container, returning the container itself.
 T setWebXML(Package resourcePackage, String resourceName)
          Adds the resource inside the package as web.xml to the container, returning the container itself.
 T setWebXML(String resourceName)
          Adds the resource as web.xml to the container, returning the container itself.
 T setWebXML(URL resource)
          Adds the URL as web.xml to the container, returning the container itself.
 
Methods inherited from class org.jboss.shrinkwrap.impl.base.container.ContainerBase
add, add, add, add, add, add, add, addAsDirectories, addAsDirectories, addAsDirectory, addAsDirectory, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibraries, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsLibrary, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResource, addAsManifestResources, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResource, addAsResources, addClass, addClass, addClass, addClasses, addDefaultPackage, addManifest, addPackage, addPackage, addPackages, addPackages, addPackages, addPackages, contains, contains, covarientReturn, delete, delete, equals, get, get, getActualClass, getArchiveFormat, getAsType, getAsType, getAsType, getAsType, getAsType, getAsType, getClassesPath, getContent, getContent, getLibraryPath, getManifestPath, getName, getResourcePath, hashCode, merge, merge, merge, merge, merge, merge, setManifest, setManifest, setManifest, setManifest, setManifest, toString, toString, toString, writeTo
 
Methods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchive
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.shrinkwrap.api.Assignable
as
 

Constructor Detail

WebContainerBase

protected WebContainerBase(Class<T> actualType,
                           Archive<?> archive)
Method Detail

getWebPath

protected abstract ArchivePath getWebPath()
Returns the path to web resources

Returns:
Base Path for the web resources

getWebInfPath

protected abstract ArchivePath getWebInfPath()
Returns the path to WEB-INF

Returns:
the path to WEB-INF

getServiceProvidersPath

protected abstract ArchivePath getServiceProvidersPath()
Returns the path to web container service providers

Returns:
the path to web container service providers

setWebXML

public T setWebXML(String resourceName)
                               throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the resource as web.xml to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Specified by:
setWebXML in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
WebContainer.setWebXML(Asset)

setWebXML

public T setWebXML(File resource)
                               throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the File as web.xml to the container, returning the container itself.

Specified by:
setWebXML in interface WebContainer<T extends Archive<T>>
Parameters:
resource - File resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.setWebXML(Asset)

setWebXML

public T setWebXML(URL resource)
                               throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the URL as web.xml to the container, returning the container itself.

Specified by:
setWebXML in interface WebContainer<T extends Archive<T>>
Parameters:
resource - URL resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.setWebXML(Asset)

setWebXML

public T setWebXML(Asset resource)
                               throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the Asset as web.xml to the container, returning the container itself.

Specified by:
setWebXML in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Asset resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
addAsWebResource(Asset, ArchivePath)

setWebXML

public T setWebXML(Package resourcePackage,
                   String resourceName)
                               throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the resource inside the package as web.xml to the container, returning the container itself.

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

Specified by:
setWebXML in interface WebContainer<T extends Archive<T>>
Parameters:
resourcePackage - The package of the resources
resourceName - The name of the resources inside resourcePackage
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourcePackage is null

addAsWebResource

public T addAsWebResource(String resourceName)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the resource as a Web resource to the container, returning the container itself.
The resource will be placed into the Container Web path under the same context from which it was retrieved.

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

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(File resource)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the File as a Web resource to the container, returning the container itself.
The File will be placed into the Container Web path under File.getName().

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - resource to add
Returns:
This virtual archive
Throws:
IllegalArgumentException - if File resource is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(String resourceName,
                          String target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the resource as a Web resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(File resource,
                          String target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the File as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(URL resource,
                          String target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the URL as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(Asset resource,
                          String target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the Asset as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(String resourceName,
                          ArchivePath target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the resource as a Web resource to the container, returning the container itself.


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

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resourceName is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(File resource,
                          ArchivePath target)
                                      throws IllegalArgumentException
Adds the File as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(java.io.File, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebResource

public T addAsWebResource(URL resource,
                          ArchivePath target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
Adds the URL as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(Asset, ArchivePath)

addAsWebResource

public T addAsWebResource(Asset resource,
                          ArchivePath target)
                                      throws IllegalArgumentException
Adds the Asset as a Web resource to the container, returning the container itself.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives web path.
Returns:
This virtual archive
Throws:
IllegalArgumentException - if resource is null
See Also:
WebContainer.addAsWebResource(org.jboss.shrinkwrap.api.asset.Asset, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebResources

public T addAsWebResources(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.

Specified by:
addAsWebResources in interface WebContainer<T extends Archive<T>>
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
See Also:
WebContainer.addAsWebResources(java.lang.Package, java.lang.String[])

addAsWebResource

public T addAsWebResource(Package resourcePackage,
                          String resourceName)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
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.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
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

addAsWebResource

public T addAsWebResource(Package resourcePackage,
                          String resourceName,
                          String target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
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.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
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

addAsWebResource

public T addAsWebResource(Package resourcePackage,
                          String resourceName,
                          ArchivePath target)
                                      throws IllegalArgumentException
Description copied from interface: WebContainer
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.

Specified by:
addAsWebResource in interface WebContainer<T extends Archive<T>>
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

addAsWebInfResource

public T addAsWebInfResource(String resourceName)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

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

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
Returns:
This Archive
Throws:
IllegalArgumentException - if resourceName is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.String)

addAsWebInfResource

public T addAsWebInfResource(File resource)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.
The File will be placed into the Container WEB-INF path under File.getName().

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Resource to add
Returns:
This Archive
Throws:
IllegalArgumentException - if File resource is null
See Also:
WebContainer.addAsWebInfResource(java.io.File)

addAsWebInfResource

public T addAsWebInfResource(String resourceName,
                             String target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.
The ClassLoader used to obtain the resource is up to the implementation.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - if resourceName or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.String, java.lang.String)

addAsWebInfResource

public T addAsWebInfResource(File resource,
                             String target)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.io.File, java.lang.String)

addAsWebInfResource

public T addAsWebInfResource(URL resource,
                             String target)
                                         throws IllegalArgumentException
Adds the URL as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.net.URL, java.lang.String)

addAsWebInfResource

public T addAsWebInfResource(Asset resource,
                             String target)
                                         throws IllegalArgumentException
Adds the Asset as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(org.jboss.shrinkwrap.api.asset.Asset, java.lang.String)

addAsWebInfResource

public T addAsWebInfResource(String resourceName,
                             ArchivePath target)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

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

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourceName - resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.String, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebInfResource

public T addAsWebInfResource(File resource,
                             ArchivePath target)
                                         throws IllegalArgumentException
Adds the File as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - File resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.io.File, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebInfResource

public T addAsWebInfResource(URL resource,
                             ArchivePath target)
                                         throws IllegalArgumentException
Adds the URL as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - URL resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.net.URL, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebInfResource

public T addAsWebInfResource(Asset resource,
                             ArchivePath target)
                                         throws IllegalArgumentException
Adds the Asset as a WEB-INF resource to the container, returning the container itself.

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resource - Asset resource to add
target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
Returns:
This Archive
Throws:
IllegalArgumentException - If the resource or target is not specified
See Also:
WebContainer.addAsWebInfResource(org.jboss.shrinkwrap.api.asset.Asset, org.jboss.shrinkwrap.api.ArchivePath)

addAsWebInfResources

public T addAsWebInfResources(Package resourcePackage,
                              String... resourceNames)
                                          throws IllegalArgumentException
Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.

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

Specified by:
addAsWebInfResources in interface WebContainer<T extends Archive<T>>
Parameters:
resourcePackage - The package of the resources
resourceNames - The names of the resources inside resourcePackage
Returns:
This Archive
Throws:
IllegalArgumentException - If resourcePackage is null, or if no resourceNames are specified or containing null
See Also:
WebContainer.addAsWebInfResources(java.lang.Package, java.lang.String[])

addAsWebInfResource

public T addAsWebInfResource(Package resourcePackage,
                             String resourceName)
                                         throws IllegalArgumentException
Adds the resource as a WEB-INF resource to the container, returning the container itself.

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

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resourcePackage
Returns:
This Archive
Throws:
IllegalArgumentException - If the package or resource name is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String)

addAsWebInfResource

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

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

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This Archive
Throws:
IllegalArgumentException - If the package, resource name, or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, java.lang.String)

addAsWebInfResource

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

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

Specified by:
addAsWebInfResource in interface WebContainer<T extends Archive<T>>
Parameters:
resourcePackage - The package of the resource
resourceName - The name of the resource inside resoucePackage
target - The target location inside the container
Returns:
This Archive
Throws:
IllegalArgumentException - If the package, resource name, or target is not specified
See Also:
WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, org.jboss.shrinkwrap.api.ArchivePath)

addAsServiceProvider

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

Specified by:
addAsServiceProvider in interface ManifestContainer<T extends Archive<T>>
Overrides:
addAsServiceProvider in class ContainerBase<T extends Archive<T>>
Parameters:
serviceInterface - The Service Interface class
serviceImpls - The Service Interface Implementations
Returns:
This virtual archive
Throws:
IllegalArgumentException - if serviceInterface is null

addAsServiceProviderAndClasses

public T addAsServiceProviderAndClasses(Class<?> serviceInterface,
                                        Class<?>... serviceImpls)
                                                    throws IllegalArgumentException
Description copied from interface: ServiceProviderContainer
Adds a META-INF/services/ServiceInterfaceName Asset and the classes related to the service to the archive.

Specified by:
addAsServiceProviderAndClasses in interface ServiceProviderContainer<T extends Archive<T>>
Overrides:
addAsServiceProviderAndClasses in class ContainerBase<T extends Archive<T>>
Parameters:
serviceInterface - The Service Interface class
serviceImpls - The Service Interface Implementations
Returns:
This virtual archive
Throws:
IllegalArgumentException - if serviceInterface is null

ShrinkWrap Aggregator and Build Parent 1.0.0-cr-1

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