Interface DeploymentDescriptor
-
public interface DeploymentDescriptorA deployment descriptor such as application.xml.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetApplicationName()The application name.java.lang.StringgetDescription()The application description.java.lang.StringgetDisplayName()The application display name.java.lang.StringgetFileName()The name of the descriptor file, typically "application.xml"java.lang.BooleangetInitializeInOrder()Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules.java.lang.StringgetLibraryDirectory()The name of the directory to look for libraries in.java.util.Set<EarModule>getModules()List of module descriptors.java.util.Map<java.lang.String,java.lang.String>getModuleTypeMappings()Mapping of module paths to module types.java.util.Set<EarSecurityRole>getSecurityRoles()List of security roles.java.lang.StringgetVersion()The version of application.xml.DeploymentDescriptormodule(java.lang.String path, java.lang.String type)Add a module to the deployment descriptor.DeploymentDescriptormodule(EarModule module, java.lang.String type)Add a module to the deployment descriptor.DeploymentDescriptorreadFrom(java.io.Reader reader)Reads the deployment descriptor from a reader.booleanreadFrom(java.lang.Object path)Reads the deployment descriptor from a file.DeploymentDescriptorsecurityRole(java.lang.String role)Add a security role to the deployment descriptor.DeploymentDescriptorsecurityRole(Action<? super EarSecurityRole> action)Add a security role to the deployment descriptor after configuring it with the given action.DeploymentDescriptorsecurityRole(EarSecurityRole role)Add a security role to the deployment descriptor.voidsetApplicationName(java.lang.String applicationName)voidsetDescription(java.lang.String description)voidsetDisplayName(java.lang.String displayName)voidsetFileName(java.lang.String fileName)voidsetInitializeInOrder(java.lang.Boolean initializeInOrder)voidsetLibraryDirectory(java.lang.String libraryDirectory)voidsetModules(java.util.Set<EarModule> modules)voidsetModuleTypeMappings(java.util.Map<java.lang.String,java.lang.String> moduleTypeMappings)voidsetSecurityRoles(java.util.Set<EarSecurityRole> securityRoles)voidsetVersion(java.lang.String version)DeploymentDescriptorwebModule(java.lang.String path, java.lang.String contextRoot)Add a web module to the deployment descriptor.DeploymentDescriptorwithXml(Closure closure)Adds a closure to be called when the XML document has been created.DeploymentDescriptorwithXml(Action<? super XmlProvider> action)Adds an action to be called when the XML document has been created.DeploymentDescriptorwriteTo(java.io.Writer writer)Writes the deployment descriptor into a writer.DeploymentDescriptorwriteTo(java.lang.Object path)Writes the deployment descriptor into a file.
-
-
-
Method Detail
-
getFileName
java.lang.String getFileName()
The name of the descriptor file, typically "application.xml"
-
setFileName
void setFileName(java.lang.String fileName)
-
getVersion
java.lang.String getVersion()
The version of application.xml. Required. Valid versions are "1.3", "1.4", "5", "6", "7", "8", "9" and "10". Defaults to "6".
-
setVersion
void setVersion(java.lang.String version)
-
getApplicationName
java.lang.String getApplicationName()
The application name. Optional. Only valid with version 6.
-
setApplicationName
void setApplicationName(java.lang.String applicationName)
-
getInitializeInOrder
java.lang.Boolean getInitializeInOrder()
Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules. Optional. Only valid with version 6.
-
setInitializeInOrder
void setInitializeInOrder(java.lang.Boolean initializeInOrder)
-
getDescription
java.lang.String getDescription()
The application description. Optional.
-
setDescription
void setDescription(java.lang.String description)
-
getDisplayName
java.lang.String getDisplayName()
The application display name. Optional.
-
setDisplayName
void setDisplayName(java.lang.String displayName)
-
getLibraryDirectory
java.lang.String getLibraryDirectory()
The name of the directory to look for libraries in. Optional. If not specified,Ear.getLibDirName()is used. Typically, this should be set viaEarPluginConvention.setLibDirName(String)instead of this property when using theearplugin.
-
setLibraryDirectory
void setLibraryDirectory(java.lang.String libraryDirectory)
-
getModules
java.util.Set<EarModule> getModules()
List of module descriptors. Must not be empty. Non-null and order-maintaining by default. Must maintain order if initializeInOrder istrue.
-
setModules
void setModules(java.util.Set<EarModule> modules)
-
module
DeploymentDescriptor module(EarModule module, java.lang.String type)
Add a module to the deployment descriptor.- Parameters:
module- The module to add.type- The type of the module, such as "ejb", "java", etc.- Returns:
- this.
-
module
DeploymentDescriptor module(java.lang.String path, java.lang.String type)
Add a module to the deployment descriptor.- Parameters:
path- The path of the module to add.type- The type of the module, such as "ejb", "java", etc.- Returns:
- this.
-
webModule
DeploymentDescriptor webModule(java.lang.String path, java.lang.String contextRoot)
Add a web module to the deployment descriptor.- Parameters:
path- The path of the module to add.contextRoot- The context root type of the web module.- Returns:
- this.
-
getSecurityRoles
java.util.Set<EarSecurityRole> getSecurityRoles()
List of security roles. Optional. Non-null and order-maintaining by default.
-
setSecurityRoles
void setSecurityRoles(java.util.Set<EarSecurityRole> securityRoles)
-
securityRole
DeploymentDescriptor securityRole(EarSecurityRole role)
Add a security role to the deployment descriptor.- Parameters:
role- The security role to add.- Returns:
- this.
-
securityRole
DeploymentDescriptor securityRole(java.lang.String role)
Add a security role to the deployment descriptor.- Parameters:
role- The name of the security role to add.- Returns:
- this.
-
securityRole
DeploymentDescriptor securityRole(Action<? super EarSecurityRole> action)
Add a security role to the deployment descriptor after configuring it with the given action.- Parameters:
action- an action to configure the security role- Returns:
- this.
-
getModuleTypeMappings
java.util.Map<java.lang.String,java.lang.String> getModuleTypeMappings()
Mapping of module paths to module types. Non-null by default. For example, to specify that a module is a java module, setmoduleTypeMappings["myJavaModule.jar"] = "java".
-
setModuleTypeMappings
void setModuleTypeMappings(java.util.Map<java.lang.String,java.lang.String> moduleTypeMappings)
-
withXml
DeploymentDescriptor withXml(@DelegatesTo(XmlProvider.class) Closure closure)
Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of aNode. The closure can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.- Parameters:
closure- The closure to execute when the XML has been created- Returns:
- this
-
withXml
DeploymentDescriptor withXml(Action<? super XmlProvider> action)
Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of aNode. The action can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.- Parameters:
action- The action to execute when the XML has been created- Returns:
- this
-
readFrom
DeploymentDescriptor readFrom(java.io.Reader reader)
Reads the deployment descriptor from a reader.- Parameters:
reader- The reader to read the deployment descriptor from- Returns:
- this
-
readFrom
boolean readFrom(java.lang.Object path)
Reads the deployment descriptor from a file. The paths are resolved as defined byProject.file(Object)- Parameters:
path- The path of the file to read the deployment descriptor from- Returns:
- whether the descriptor could be read from the given path
-
writeTo
DeploymentDescriptor writeTo(java.io.Writer writer)
Writes the deployment descriptor into a writer.- Parameters:
writer- The writer to write the deployment descriptor to- Returns:
- this
-
writeTo
DeploymentDescriptor writeTo(java.lang.Object path)
Writes the deployment descriptor into a file. The paths are resolved as defined byProject.file(Object)- Parameters:
path- The path of the file to write the deployment descriptor into.- Returns:
- this
-
-