Interface DeploymentDescriptor
public interface DeploymentDescriptor
A deployment descriptor such as application.xml.
-
Method Summary
Modifier and TypeMethodDescriptionThe application name.The application description.The application display name.The name of the descriptor file, typically "application.xml"Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules.The name of the directory to look for libraries in.List of module descriptors.Mapping of module paths to module types.List of security roles.The version of application.xml.Add a module to the deployment descriptor.Add a module to the deployment descriptor.Reads the deployment descriptor from a reader.boolean
Reads the deployment descriptor from a file.securityRole
(String role) Add a security role to the deployment descriptor.securityRole
(Action<? super EarSecurityRole> action) Add a security role to the deployment descriptor after configuring it with the given action.securityRole
(EarSecurityRole role) Add a security role to the deployment descriptor.void
setApplicationName
(String applicationName) void
setDescription
(String description) void
setDisplayName
(String displayName) void
setFileName
(String fileName) void
setInitializeInOrder
(Boolean initializeInOrder) void
setLibraryDirectory
(String libraryDirectory) void
setModules
(Set<EarModule> modules) void
setModuleTypeMappings
(Map<String, String> moduleTypeMappings) void
setSecurityRoles
(Set<EarSecurityRole> securityRoles) void
setVersion
(String version) Add a web module to the deployment descriptor.Adds a closure to be called when the XML document has been created.withXml
(Action<? super XmlProvider> action) Adds an action to be called when the XML document has been created.Writes the deployment descriptor into a writer.Writes the deployment descriptor into a file.
-
Method Details
-
getFileName
String getFileName()The name of the descriptor file, typically "application.xml" -
setFileName
-
getVersion
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
-
getApplicationName
String getApplicationName()The application name. Optional. Only valid with version 6. -
setApplicationName
-
getInitializeInOrder
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
-
getDescription
String getDescription()The application description. Optional. -
setDescription
-
getDisplayName
String getDisplayName()The application display name. Optional. -
setDisplayName
-
getLibraryDirectory
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 theear
plugin. -
setLibraryDirectory
-
getModules
List of module descriptors. Must not be empty. Non-null and order-maintaining by default. Must maintain order if initializeInOrder istrue
. -
setModules
-
module
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
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
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
Set<EarSecurityRole> getSecurityRoles()List of security roles. Optional. Non-null and order-maintaining by default. -
setSecurityRoles
-
securityRole
Add a security role to the deployment descriptor.- Parameters:
role
- The security role to add.- Returns:
- this.
-
securityRole
Add a security role to the deployment descriptor.- Parameters:
role
- The name of the security role to add.- Returns:
- this.
-
securityRole
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
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
-
withXml
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
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
Reads the deployment descriptor from a reader.- Parameters:
reader
- The reader to read the deployment descriptor from- Returns:
- this
-
readFrom
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
Writes the deployment descriptor into a writer.- Parameters:
writer
- The writer to write the deployment descriptor to- Returns:
- this
-
writeTo
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
-