Interface LibraryContainer<T extends Archive<T>>
-
- All Known Subinterfaces:
EnterpriseArchive
,ResourceAdapterArchive
,WebArchive
- All Known Implementing Classes:
ContainerBase
,EnterpriseArchiveImpl
,EnterpriseContainerBase
,GenericArchiveImpl
,JavaArchiveImpl
,ResourceAdapterArchiveImpl
,ResourceAdapterContainerBase
,WebArchiveImpl
,WebContainerBase
public interface LibraryContainer<T extends Archive<T>>
Defines the contract for a component capable of storing Libraries.
The actual path to the Library resources within theArchive
is up to the implementations/specifications.- Version:
- $Revision: $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addAsLibraries(java.io.File... resources)
Add multipleFile
to thisArchive
as libraries to the container, returning the container itself.T
addAsLibraries(java.lang.String... resourceNames)
Add multiple resources to thisArchive
as libraries to the container, returning the container itself.T
addAsLibraries(java.util.Collection<? extends Archive<?>> archives)
T
addAsLibraries(Archive<?>... archives)
T
addAsLibraries(Archive<?>[]... archives)
T
addAsLibrary(java.io.File resource)
Adds theFile
as a library to the container, returning the container itself.T
addAsLibrary(java.io.File resource, java.lang.String target)
Adds theFile
as a library to the container, returning the container itself.T
addAsLibrary(java.io.File resource, ArchivePath target)
Adds theFile
as a library to the container, returning the container itself.T
addAsLibrary(java.lang.String resourceName)
Adds the resource as a library to the container, returning the container itself.T
addAsLibrary(java.lang.String resourceName, java.lang.String target)
Adds the resource as a library to the container, returning the container itself.T
addAsLibrary(java.lang.String resourceName, ArchivePath target)
Adds the resource as a library to the container, returning the container itself.T
addAsLibrary(java.net.URL resource, java.lang.String target)
Adds theURL
as a library to the container, returning the container itself.T
addAsLibrary(java.net.URL resource, ArchivePath target)
Adds theURL
as a library to the container, returning the container itself.T
addAsLibrary(Archive<?> archive)
T
addAsLibrary(Asset resource, java.lang.String target)
Adds theAsset
as a library to the container, returning the container itself.T
addAsLibrary(Asset resource, ArchivePath target)
Adds theAsset
as a library to the container, returning the container itself.
-
-
-
Method Detail
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName) throws java.lang.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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resourceName is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource) throws java.lang.IllegalArgumentException
Adds theFile
as a library to the container, returning the container itself.
TheFile
will be placed into the Container Library path underFile.getName()
.- Parameters:
resource
-File
resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resourceName is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName, java.lang.String target) throws java.lang.IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resourceName is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theFile
as a library to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.net.URL resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theURL
as a library to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(Asset resource, java.lang.String target) throws java.lang.IllegalArgumentException
Adds theAsset
as a library to the container, returning the container itself.- Parameters:
resource
-Asset
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.lang.String resourceName, ArchivePath target) throws java.lang.IllegalArgumentException
Adds the resource as a library to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resourceName is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.io.File resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theFile
as a library to the container, returning the container itself.- Parameters:
resource
-File
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(java.net.URL resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theURL
as a library to the container, returning the container itself.- Parameters:
resource
-URL
resource to addtarget
- The target path within the archive in which to add the resource, relative to theArchive
s library path.- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibrary
T addAsLibrary(Asset resource, ArchivePath target) throws java.lang.IllegalArgumentException
Adds theAsset
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 theArchive
s library path.resource
-Asset
resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resource is nulljava.lang.IllegalArgumentException
- if target is null
-
addAsLibrary
T addAsLibrary(Archive<?> archive) throws java.lang.IllegalArgumentException
Add anotherArchive
to thisArchive
as a library to the container, returning the container itself.
TheArchive
will be placed into the Container Library path underArchive.getName()
.- Parameters:
archive
-Archive
resource to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- ifArchive
is null- See Also:
addAsLibrary(Asset, ArchivePath)
-
addAsLibraries
T addAsLibraries(java.lang.String... resourceNames) throws java.lang.IllegalArgumentException
Add multiple resources to thisArchive
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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceNames
- resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- if resourceNames are null or empty- See Also:
addAsLibrary(String)
-
addAsLibraries
T addAsLibraries(java.io.File... resources) throws java.lang.IllegalArgumentException
Add multipleFile
to thisArchive
as libraries to the container, returning the container itself.
TheFile
s will be placed into the Container Library path underFile.getName()
.- Parameters:
resources
-File
resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- ifFile
resources are null or empty- See Also:
addAsLibrary(File)
-
addAsLibraries
T addAsLibraries(Archive<?>... archives) throws java.lang.IllegalArgumentException
Add multipleArchive
s to thisArchive
as libraries to the container, returning the container itself.
TheArchive
s will be placed into the Container Library path underArchive.getName()
.- Parameters:
archives
-Archive
resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- ifArchive
resources are null- See Also:
addAsLibrary(Archive)
-
addAsLibraries
T addAsLibraries(java.util.Collection<? extends Archive<?>> archives) throws java.lang.IllegalArgumentException
Add multipleArchive
s to thisArchive
as libraries to the container, returning the container itself.
TheArchive
s will be placed into the Container Library path underArchive.getName()
.- Parameters:
archives
-Archive
resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- ifCollection
of archives is null- See Also:
addAsLibrary(Archive)
-
addAsLibraries
T addAsLibraries(Archive<?>[]... archives) throws java.lang.IllegalArgumentException
Add multipleArchive
s to thisArchive
as libraries to the container, returning the container itself.
TheArchive
s will be placed into the Container Library path underArchive.getName()
.- Parameters:
archives
-Archive
resources to add- Returns:
- This virtual archive
- Throws:
java.lang.IllegalArgumentException
- ifCollection
of archives is null- See Also:
addAsLibrary(Archive)
-
-