Class EnterpriseContainerBase<T extends Archive<T>>
java.lang.Object
org.jboss.shrinkwrap.impl.base.AssignableBase<Archive<?>>
org.jboss.shrinkwrap.impl.base.container.ContainerBase<T>
org.jboss.shrinkwrap.impl.base.container.EnterpriseContainerBase<T>
- Type Parameters:
T
-
- All Implemented Interfaces:
Archive<T>
,Assignable
,ClassContainer<T>
,EnterpriseContainer<T>
,LibraryContainer<T>
,ManifestContainer<T>
,ResourceContainer<T>
,ServiceProviderContainer<T>
,ArchiveFormatAssociable
- Direct Known Subclasses:
EnterpriseArchiveImpl
public abstract class EnterpriseContainerBase<T extends Archive<T>>
extends ContainerBase<T>
implements EnterpriseContainer<T>
EnterpriseContainerSupport
Abstract class that helps implement the EnterpriseContainer. Used by specs that extends the EnterpriseContainer.
- Version:
- $Revision: $
-
Field Summary
Fields inherited from interface org.jboss.shrinkwrap.api.container.ManifestContainer
DEFAULT_MANIFEST_NAME
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
EnterpriseContainerBase
(Class<T> actualType, Archive<?> archive) -
Method Summary
Modifier and TypeMethodDescriptionaddAsApplicationResource
(File resource) addAsApplicationResource
(File resource, String target) addAsApplicationResource
(File resource, ArchivePath target) addAsApplicationResource
(Package resourcePackage, String resourceName) Adds the resource as a resource to the container, returning the container itself.addAsApplicationResource
(Package resourcePackage, String resourceName, String target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsApplicationResource
(Package resourcePackage, String resourceName, ArchivePath target) Adds the resource as a resource to a specific path inside the container, returning the container itself.addAsApplicationResource
(String resourceName) Adds a resource to thisArchive
s application context.addAsApplicationResource
(String resourceName, String target) Adds a resource to thisArchive
s application context.addAsApplicationResource
(String resourceName, ArchivePath target) Adds a resource to thisArchive
s application context.addAsApplicationResource
(URL resource, String target) addAsApplicationResource
(URL resource, ArchivePath target) addAsApplicationResource
(Asset resource, String target) addAsApplicationResource
(Asset resource, ArchivePath target) addAsApplicationResources
(Package resourcePackage, String... resourceNames) Adds the resources inside the package as multiple resources to the container, returning the container itself.addAsModule
(File resource) addAsModule
(File resource, String targetPath) addAsModule
(File resource, ArchivePath targetPath) addAsModule
(String resourceName) Adds a resource to thisArchive
s module context.addAsModule
(String resourceName, String targetPath) Adds a resource to thisArchive
s module context.addAsModule
(String resourceName, ArchivePath targetPath) Adds a resource to thisArchive
s module context.addAsModule
(URL resource, String targetPath) addAsModule
(URL resource, ArchivePath targetPath) addAsModule
(Archive<?> archive) Adds a archive to thisArchive
s module context.addAsModule
(Asset resource, String targetPath) addAsModule
(Asset resource, ArchivePath targetPath) addAsModules
(File... resources) addAsModules
(String... resourceNames) Adds the specified resources to thisArchive
s module context.addAsModules
(Archive<?>... archives) Adds the specified archives to thisArchive
s module context.protected abstract ArchivePath
Should be implemented to set the path for Application related resources.protected abstract ArchivePath
Should be implemented to set the path for Module related resources.setApplicationXML
(File resource) setApplicationXML
(Package resourcePackage, String resourceName) Adds a resource inside the package to thisArchive
as application.xml.setApplicationXML
(String resourceName) Adds a resource to thisArchive
as application.xml.setApplicationXML
(URL resource) setApplicationXML
(Asset resource) 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, addAsServiceProvider, addAsServiceProvider, addAsServiceProviderAndClasses, addClass, addClass, addClass, addClasses, addDefaultPackage, addHandlers, addManifest, addPackage, addPackage, addPackages, addPackages, addPackages, addPackages, contains, contains, covarientReturn, delete, delete, deleteClass, deleteClass, deleteClasses, deleteDefaultPackage, deletePackage, deletePackage, deletePackages, deletePackages, deletePackages, deletePackages, equals, filter, get, get, getActualClass, getArchiveFormat, getAsType, getAsType, getAsType, getAsType, getAsType, getAsType, getClassesPath, getContent, getContent, getId, getLibraryPath, getManifestPath, getName, getResourcePath, hashCode, merge, merge, merge, merge, merge, merge, move, move, setManifest, setManifest, setManifest, setManifest, setManifest, shallowCopy, shallowCopy, 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 Details
-
EnterpriseContainerBase
-
-
Method Details
-
getApplicationPath
Should be implemented to set the path for Application related resources.- Returns:
- Base Path for the EnterpriseContainer application resources
-
setApplicationXML
Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
as application.xml.
TheClassLoader
used to obtain the resource is up to the implementation.
For instance a resourceName of "test/example.xml" could be placed in "/META-INF/application.xml"- Specified by:
setApplicationXML
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainer
Adds aFile
to thisArchive
as application.xml.
For instance aFile
"test/example.xml" could be placed in "/META-INF/application.xml"- Specified by:
setApplicationXML
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainer
Adds aURL
to thisArchive
as application.xml.
For instance aURL
"http://my.com/example.xml" could be placed in "/META-INF/application.xml"- Specified by:
setApplicationXML
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainer
- Specified by:
setApplicationXML
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-Asset
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is null
-
setApplicationXML
public T setApplicationXML(Package resourcePackage, String resourceName) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
Adds a resource inside the package to thisArchive
as application.xml.
TheClassLoader
used to obtain the resource is up to the implementation.- Specified by:
setApplicationXML
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourcePackage
- The package of the resourcesresourceName
- The name of the resource inside resourcePackage- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourcePackage is nullIllegalArgumentException
- if resourceName is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
s application context.
TheClassLoader
used to obtain the resource is up to the implementation.
For instance a resourceName of "test/example.xml" could be placed in "/META-INF/test/example.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
Adds aFile
to thisArchive
s application context.
For instance aFile
of "test/example.xml" could be placed in "/META-INF/test/example.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is null- See Also:
-
addAsApplicationResource
public T addAsApplicationResource(String resourceName, String target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
s application context.
TheClassLoader
used to obtain the resource is up to the implementation.
For instance a resourceName of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
Adds aFile
to thisArchive
s application context.
For instance aFile
of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
Adds aURL
to thisArchive
s application context.
For instance aURL
of "http://my.com/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-Asset
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
public T addAsApplicationResource(String resourceName, ArchivePath target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
s application context.
TheClassLoader
used to obtain the resource is up to the implementation.
For instance a resourceName of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
public T addAsApplicationResource(File resource, ArchivePath target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
Adds aFile
to thisArchive
s application context.
For instance aFile
of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainer
Adds aURL
to thisArchive
s application context.
For instance aFile
of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null- See Also:
-
addAsApplicationResource
public T addAsApplicationResource(Asset resource, ArchivePath target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-Asset
resource to addtarget
- The target relative to application path within the archive into which we'll place the resource- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if target is null
-
addAsApplicationResources
public T addAsApplicationResources(Package resourcePackage, String... resourceNames) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
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.- Specified by:
addAsApplicationResources
in interfaceEnterpriseContainer<T extends Archive<T>>
- 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
-
addAsApplicationResource
public T addAsApplicationResource(Package resourcePackage, String resourceName) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
Adds the resource as a resource to the container, returning the container itself.
TheClassLoader
used to obtain the resource is up to the implementation.- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- 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
-
addAsApplicationResource
public T addAsApplicationResource(Package resourcePackage, String resourceName, String target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
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.- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- 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
-
addAsApplicationResource
public T addAsApplicationResource(Package resourcePackage, String resourceName, ArchivePath target) throws IllegalArgumentException Description copied from interface:EnterpriseContainer
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.- Specified by:
addAsApplicationResource
in interfaceEnterpriseContainer<T extends Archive<T>>
- 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
-
getModulePath
Should be implemented to set the path for Module related resources.- Returns:
- Base Path for the EnterpriseContainer module resources
-
addAsModule
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
archive
- The archive to use- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if archive is null- See Also:
-
addAsModule
Adds a resource to thisArchive
s module context.
The resource name is used as path.- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to add- Returns:
- This virtual archive
- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is null- See Also:
-
addAsModules
- Specified by:
addAsModules
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
archives
- The archives to use- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if not archives are specified- See Also:
-
addAsModules
Adds the specified resources to thisArchive
s module context.
The resource names are used as paths.- Specified by:
addAsModules
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceNames
- Names of theClassLoader
resources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceNames are not specified- See Also:
-
addAsModules
- Specified by:
addAsModules
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resources
-File
resources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resources are not specified- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
s module context.- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-File
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-Asset
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
Adds a resource to thisArchive
s module context.- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resourceName
- Name of theClassLoader
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resourceName is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if resource is nullIllegalArgumentException
- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer
- Specified by:
addAsModule
in interfaceEnterpriseContainer<T extends Archive<T>>
- Parameters:
resource
-URL
resource to addtargetPath
- The target path within the archive in which to add the resource, relative to theArchive
s module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException
- if targetPath is nullIllegalArgumentException
- if resource is null
-