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 the
The actual path to the Manifest resources within the
Archive
is up to the implementations/specifications.- Version:
- $Revision: $
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddAsManifestResource
(File resource) Adds theFile
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(File resource, String target) Adds theFile
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(File resource, ArchivePath target) Adds theFile
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(Package resourcePackage, String resourceName) Adds the resource as a resource to the container, returning the container itself.addAsManifestResource
(Package resourcePackage, String resourceName, String target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsManifestResource
(Package resourcePackage, String resourceName, ArchivePath target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsManifestResource
(String resourceName) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource
(String resourceName, String target) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource
(String resourceName, ArchivePath target) Adds the resource as a Manifest resource to the container, returning the container itself.addAsManifestResource
(URL resource, String target) Adds theURL
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(URL resource, ArchivePath target) Adds theURL
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(Asset resource, String target) Adds theAsset
as a Manifest resource to the container, returning the container itself.addAsManifestResource
(Asset resource, ArchivePath target) Adds theAsset
as a Manifest resource to the container, returning the container itself.addAsManifestResources
(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple resources to the container, returning the container itself.addAsServiceProvider
(Class<?> serviceInterface, Class<?>... serviceImpls) Adds a META-INF/services/ServiceInterfaceNameAsset
representing this service.addAsServiceProvider
(String serviceInterface, String... serviceImpls) Adds a META-INF/services/ServiceInterfaceNameAsset
representing this service.Adds a default generated MANIFEST.MF manifest to the current archive.setManifest
(File resource) Adds theFile
as MANIFEST.FM to the container, returning the container itself.setManifest
(Package resourcePackage, String resourceName) Adds the resource inside the package as a MANIFEST.MF to the container, returning the container itself.setManifest
(String resourceName) Adds the resource as MANIFEST.FM to the container, returning the container itself.setManifest
(URL resource) Adds theURL
as MANIFEST.FM to the container, returning the container itself.setManifest
(Asset resource) Adds theAsset
as MANIFEST.FM to the container, returning the container itself.
-
Field Details
-
DEFAULT_MANIFEST_NAME
- See Also:
-
-
Method Details
-
setManifest
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
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
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
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:
-
setManifest
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
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
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
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
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
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
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
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
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
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
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
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:
-
addManifest
Adds a default generated MANIFEST.MF manifest to the current archive.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if serviceInterface is null
-