Class DeploymentDescriptors
- java.lang.Object
-
- org.wildfly.testing.tools.deployments.DeploymentDescriptors
-
public class DeploymentDescriptors extends Object
A utility to generate various deployment descriptors.- Author:
- James R. Perkins
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends org.jboss.shrinkwrap.api.container.WebContainer<T> & org.jboss.shrinkwrap.api.Archive<T>>
TaddJBossDeploymentStructure(T archive, Set<String> addedModules, Set<String> excludedModules)Adds ajboss-deployment-structure.xmlfile to a deployment with optional dependency additions or exclusions.static Collection<Permission>addModuleFilePermission(String... moduleNames)This should only be used as a workaround for issues with API's where something like aServiceLoaderneeds access to an implementation.static byte[]createJBossDeploymentStructure(Set<String> addedModules, Set<String> excludedModules)Creates ajboss-deployment-structure.xmlfile with the optional dependency additions or exclusions.static org.jboss.shrinkwrap.api.asset.AssetcreateJBossDeploymentStructureAsset(Set<String> addedModules, Set<String> excludedModules)Creates ajboss-deployment-structure.xmlfile with the optional dependency additions or exclusions.static org.jboss.shrinkwrap.api.asset.AssetcreateJBossWebContextRoot(String contextRoot)Creates ajboss-web.xmlwith the context root provided.static org.jboss.shrinkwrap.api.asset.AssetcreateJBossWebSecurityDomain(String securityDomain)Creates ajboss-web.xmlwith the security domain for the deployment.static byte[]createJBossWebXml(Map<String,String> elements)Creates ajboss-web.xmlwith simple attributes.static org.jboss.shrinkwrap.api.asset.AssetcreateJBossWebXmlAsset(Map<String,String> elements)Creates ajboss-web.xmlwith simple attributes.static byte[]createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions)Creates a new asset with the given contents for apermissions.xmlfile.static byte[]createPermissionsXml(Permission... permissions)Creates a new asset with the given contents for apermissions.xmlfile.static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Iterable<? extends Permission> permissions)Creates a new asset with the given contents for apermissions.xmlfile.static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Iterable<? extends Permission> permissions, Permission... additionalPermissions)Creates a new asset with the given contents for apermissions.xmlfile.static org.jboss.shrinkwrap.api.asset.AssetcreatePermissionsXmlAsset(Permission... permissions)Creates a new asset with the given contents for apermissions.xmlfile.static Collection<FilePermission>createTempDirPermission(String actions)Creates the permissions required for thejava.io.tmpdir.
-
-
-
Method Detail
-
addJBossDeploymentStructure
public static <T extends org.jboss.shrinkwrap.api.container.WebContainer<T> & org.jboss.shrinkwrap.api.Archive<T>> T addJBossDeploymentStructure(T archive, Set<String> addedModules, Set<String> excludedModules)Adds ajboss-deployment-structure.xmlfile to a deployment with optional dependency additions or exclusions.- Type Parameters:
T- the archive type- Parameters:
archive- the archive to add thejboss-deployment-structure.xmltoaddedModules- the modules to add to an archive or an empty setexcludedModules- the modules to exclude from an archive or an empty set- Returns:
- the archive
-
createJBossDeploymentStructureAsset
public static org.jboss.shrinkwrap.api.asset.Asset createJBossDeploymentStructureAsset(Set<String> addedModules, Set<String> excludedModules)
Creates ajboss-deployment-structure.xmlfile with the optional dependency additions or exclusions.- Parameters:
addedModules- the modules to add or an empty setexcludedModules- the modules to exclude or an empty set- Returns:
- a
jboss-deployment-structure.xmlasset
-
createJBossDeploymentStructure
public static byte[] createJBossDeploymentStructure(Set<String> addedModules, Set<String> excludedModules)
Creates ajboss-deployment-structure.xmlfile with the optional dependency additions or exclusions.- Parameters:
addedModules- the modules to add or an empty setexcludedModules- the modules to exclude or an empty set- Returns:
- a
jboss-deployment-structure.xmlin a byte array
-
createJBossWebContextRoot
public static org.jboss.shrinkwrap.api.asset.Asset createJBossWebContextRoot(String contextRoot)
Creates ajboss-web.xmlwith the context root provided.- Parameters:
contextRoot- the context root to use for the deployment- Returns:
- a
jboss-web.xml
-
createJBossWebSecurityDomain
public static org.jboss.shrinkwrap.api.asset.Asset createJBossWebSecurityDomain(String securityDomain)
Creates ajboss-web.xmlwith the security domain for the deployment.- Parameters:
securityDomain- the security domain to use for the deployment- Returns:
- a
jboss-web.xml
-
createJBossWebXmlAsset
public static org.jboss.shrinkwrap.api.asset.Asset createJBossWebXmlAsset(Map<String,String> elements)
Creates ajboss-web.xmlwith simple attributes.- Parameters:
elements- the elements to add where the key is the element name and the value is the elements value- Returns:
- a
jboss-web.xml
-
createJBossWebXml
public static byte[] createJBossWebXml(Map<String,String> elements)
Creates ajboss-web.xmlwith simple attributes.- Parameters:
elements- the elements to add where the key is the element name and the value is the elements value- Returns:
- a
jboss-web.xml
-
createPermissionsXmlAsset
public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Permission... permissions)
Creates a new asset with the given contents for apermissions.xmlfile.- Parameters:
permissions- the permissions to add to the file- Returns:
- an asset with the given contents for a
permissions.xmlfile
-
createPermissionsXmlAsset
public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
Creates a new asset with the given contents for apermissions.xmlfile.- Parameters:
permissions- the permissions to add to the fileadditionalPermissions- any additional permissions to add to the file- Returns:
- an asset with the given contents for a
permissions.xmlfile
-
createPermissionsXmlAsset
public static org.jboss.shrinkwrap.api.asset.Asset createPermissionsXmlAsset(Iterable<? extends Permission> permissions)
Creates a new asset with the given contents for apermissions.xmlfile.- Parameters:
permissions- the permissions to add to the file- Returns:
- an asset with the given contents for a
permissions.xmlfile
-
createPermissionsXml
public static byte[] createPermissionsXml(Permission... permissions)
Creates a new asset with the given contents for apermissions.xmlfile.- Parameters:
permissions- the permissions to add to the file- Returns:
- an asset with the given contents for a
permissions.xmlfile
-
createPermissionsXml
public static byte[] createPermissionsXml(Iterable<? extends Permission> permissions, Permission... additionalPermissions)
Creates a new asset with the given contents for apermissions.xmlfile.- Parameters:
permissions- the permissions to add to the fileadditionalPermissions- any additional permissions to add to the file- Returns:
- an asset with the given contents for a
permissions.xmlfile
-
addModuleFilePermission
public static Collection<Permission> addModuleFilePermission(String... moduleNames)
This should only be used as a workaround for issues with API's where something like aServiceLoaderneeds access to an implementation.Adds file permissions for every JAR in the modules directory. The
module.jar.pathsystem property must be set.- Parameters:
moduleNames- the module names to add file permissions for- Returns:
- a collection of permissions required
-
createTempDirPermission
public static Collection<FilePermission> createTempDirPermission(String actions)
Creates the permissions required for thejava.io.tmpdir. This adds permissions to read the directory, then adds permissions for all files and subdirectories of the temporary directory. The actions are used for the latter permission.- Parameters:
actions- the actions required for the temporary directory- Returns:
- the permissions required
-
-