Interface ManifestContainer<T extends Archive<T>>
-
- Type Parameters:
T
-
- All Known Subinterfaces:
EnterpriseArchive
,JavaArchive
,ResourceAdapterArchive
,ServiceProviderContainer<T>
,WebArchive
- All Known Implementing Classes:
ContainerBase
,EnterpriseArchiveImpl
,EnterpriseContainerBase
,GenericArchiveImpl
,JavaArchiveImpl
,ResourceAdapterArchiveImpl
,ResourceAdapterContainerBase
,WebArchiveImpl
,WebContainerBase
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 theArchive
is up to the implementations/specifications.- Version:
- $Revision: $
- Author:
- Aslak Knutsen
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_MANIFEST_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
addAsManifestResource(File resource)
Adds theFile
as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(File resource, String target)
Adds theFile
as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(File resource, ArchivePath target)
Adds theFile
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, String target)
Adds the resource as a resource to a specific path inside 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(String resourceName)
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(String resourceName, ArchivePath target)
Adds the resource as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(URL resource, String target)
Adds theURL
as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(URL resource, ArchivePath target)
Adds theURL
as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(Asset resource, String target)
Adds theAsset
as a Manifest resource to the container, returning the container itself.T
addAsManifestResource(Asset resource, ArchivePath target)
Adds theAsset
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/ServiceInterfaceNameAsset
representing this service.T
addAsServiceProvider(String serviceInterface, String... serviceImpls)
Adds a META-INF/services/ServiceInterfaceNameAsset
representing this service.T
addManifest()
Adds a default generated MANIFEST.MF manifest to the current archive.T
setManifest(File resource)
Adds theFile
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 theURL
as MANIFEST.FM to the container, returning the container itself.T
setManifest(Asset resource)
Adds theAsset
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.
TheClassLoader
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 theFile
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 theURL
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 theAsset
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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourceName
- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null
-
addAsManifestResource
T addAsManifestResource(File resource) throws IllegalArgumentException
Adds theFile
as a Manifest resource to the container, returning the container itself.
TheFile
will be placed into the Container Manifest path underFile.getName()
.- Parameters:
resource
- resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- ifFile
resource is nullIllegalArgumentException
- 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.
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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(File resource, String target) throws IllegalArgumentException
Adds theFile
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(URL resource, String target) throws IllegalArgumentException
Adds theURL
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(Asset resource, String target) throws IllegalArgumentException
Adds theAsset
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- 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.
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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(File resource, ArchivePath target) throws IllegalArgumentException
Adds theFile
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(URL resource, ArchivePath target) throws IllegalArgumentException
Adds theURL
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
addAsManifestResource(Asset, ArchivePath)
-
addAsManifestResource
T addAsManifestResource(Asset resource, ArchivePath target) throws IllegalArgumentException
Adds theAsset
as a Manifest resource 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 manifest path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourcesresourceNames
- The names of the resources inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is nullIllegalArgumentException
- 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.
TheClassLoader
used to obtain the resource is up to the implementation.- Parameters:
resourcePackage
- The package of the resourceresourceName
- The name of the resource inside resoucePackagetarget
- The target location inside the container- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null
-
addAsServiceProvider
T addAsServiceProvider(Class<?> serviceInterface, Class<?>... serviceImpls) throws IllegalArgumentException
Adds a META-INF/services/ServiceInterfaceNameAsset
representing this service. Warning: this method does not add the specified classes to the archive.- Parameters:
serviceInterface
- The Service Interface classserviceImpls
- The Service Interface Implementations- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if serviceInterface is nullIllegalArgumentException
- if serviceImpls is null or contain null values
-
addAsServiceProvider
T addAsServiceProvider(String serviceInterface, String... serviceImpls)
Adds a META-INF/services/ServiceInterfaceNameAsset
representing this service.- Parameters:
serviceInterface
- The Service Interface class nameserviceImpls
- The Service Interface Implementations class names- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if serviceInterface is nullIllegalArgumentException
- if serviceImpls is null or contain null values- See Also:
addAsServiceProvider(Class, Class...)
-
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
-
-