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
ConstructorsModifierConstructorDescriptionprotectedEnterpriseContainerBase(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 thisArchives application context.addAsApplicationResource(String resourceName, String target) Adds a resource to thisArchives application context.addAsApplicationResource(String resourceName, ArchivePath target) Adds a resource to thisArchives 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 thisArchives module context.addAsModule(String resourceName, String targetPath) Adds a resource to thisArchives module context.addAsModule(String resourceName, ArchivePath targetPath) Adds a resource to thisArchives module context.addAsModule(URL resource, String targetPath) addAsModule(URL resource, ArchivePath targetPath) addAsModule(Archive<?> archive) Adds a archive to thisArchives module context.addAsModule(Asset resource, String targetPath) addAsModule(Asset resource, ArchivePath targetPath) addAsModules(File... resources) addAsModules(String... resourceNames) Adds the specified resources to thisArchives module context.addAsModules(Archive<?>... archives) Adds the specified archives to thisArchives module context.protected abstract ArchivePathShould be implemented to set the path for Application related resources.protected abstract ArchivePathShould 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 thisArchiveas application.xml.setApplicationXML(String resourceName) Adds a resource to thisArchiveas 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, writeToMethods inherited from class org.jboss.shrinkwrap.impl.base.AssignableBase
as, getArchiveMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:EnterpriseContainerAdds a resource to thisArchiveas application.xml.
TheClassLoaderused 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:
setApplicationXMLin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainerAdds aFileto thisArchiveas application.xml.
For instance aFile"test/example.xml" could be placed in "/META-INF/application.xml"- Specified by:
setApplicationXMLin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainerAdds aURLto thisArchiveas application.xml.
For instance aURL"http://my.com/example.xml" could be placed in "/META-INF/application.xml"- Specified by:
setApplicationXMLin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
setApplicationXML
Description copied from interface:EnterpriseContainer- Specified by:
setApplicationXMLin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Assetresource 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:EnterpriseContainerAdds a resource inside the package to thisArchiveas application.xml.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
setApplicationXMLin 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:EnterpriseContainerAdds a resource to thisArchives application context.
TheClassLoaderused 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:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceName is null- See Also:
-
addAsApplicationResource
Description copied from interface:EnterpriseContainerAdds aFileto thisArchives application context.
For instance aFileof "test/example.xml" could be placed in "/META-INF/test/example.xml"- Specified by:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource 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:EnterpriseContainerAdds a resource to thisArchives application context.
TheClassLoaderused 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:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource 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:EnterpriseContainerAdds aFileto thisArchives application context.
For instance aFileof "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource 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:EnterpriseContainerAdds aURLto thisArchives application context.
For instance aURLof "http://my.com/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource 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:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Assetresource 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:EnterpriseContainerAdds a resource to thisArchives application context.
TheClassLoaderused 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:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource 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:EnterpriseContainerAdds aFileto thisArchives application context.
For instance aFileof "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource 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:EnterpriseContainerAdds aURLto thisArchives application context.
For instance aFileof "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"- Specified by:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource 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:
addAsApplicationResourcein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Assetresource 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:EnterpriseContainerAdds the resources inside the package as multiple resources to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsApplicationResourcesin 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:EnterpriseContainerAdds the resource as a resource to the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsApplicationResourcein 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:EnterpriseContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsApplicationResourcein 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:EnterpriseContainerAdds the resource as a resource to a specific path inside the container, returning the container itself.
TheClassLoaderused to obtain the resource is up to the implementation.- Specified by:
addAsApplicationResourcein 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:
addAsModulein 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 thisArchives module context.
The resource name is used as path.- Specified by:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to add- Returns:
- This virtual archive
- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer- Specified by:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is null- See Also:
-
addAsModules
- Specified by:
addAsModulesin 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 thisArchives module context.
The resource names are used as paths.- Specified by:
addAsModulesin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceNames- Names of theClassLoaderresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resourceNames are not specified- See Also:
-
addAsModules
- Specified by:
addAsModulesin interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resources-Fileresources to add- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resources are not specified- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainer- Specified by:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainerAdds a resource to thisArchives module context.- Specified by:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives 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:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives 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:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Fileresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives 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:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-Assetresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if resource is nullIllegalArgumentException- if targetPath is null- See Also:
-
addAsModule
Description copied from interface:EnterpriseContainerAdds a resource to thisArchives module context.- Specified by:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resourceName- Name of theClassLoaderresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives 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:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives 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:
addAsModulein interfaceEnterpriseContainer<T extends Archive<T>>- Parameters:
resource-URLresource to addtargetPath- The target path within the archive in which to add the resource, relative to theArchives module path.- Returns:
- This virtual archive
- Throws:
IllegalArgumentException- if targetPath is nullIllegalArgumentException- if resource is null
-