Extends the MatchingTask class provided in the default ant distribution to provide a directory scanning EJB jarfile generator.
The task works by taking the deployment descriptors one at a time and parsing them to locate the names of the classes which should be placed in the jar. The classnames are translated to java.io.Files by replacing periods with File.separatorChar and resolving the generated filename as a relative path under the srcDir attribute. All necessary files are then assembled into a jarfile. One jarfile is constructed for each deployment descriptor found.
| Modifier and Type | Class and Description |
|---|---|
| public static class | EjbJar.CMPVersion
CMP versions supported valid CMP versions are 1.0 and 2.0 |
| pack-priv static class | EjbJar.Config
A class which contains the configuration state of the ejbjar task. |
| public static class | EjbJar.DTDLocation
Inner class used to record information about the location of a local DTD |
| public static class | EjbJar.NamingScheme
An EnumeratedAttribute class for handling different EJB jar naming schemes |
| Modifier and Type | Field and Description |
|---|---|
| private String | cmpVersion
Instance variable that stores the CMP version for the JBoss jarfile. |
| private EjbJar. | config
The config which is built by this task and used by the various deployment tools to access the configuration of the ejbjar task |
| private List | deploymentTools
The list of deployment tools we are going to run. |
| private File | destDir
Stores a handle to the directory to put the Jar files in. This is only used by the generic deployment descriptor tool which is created if no other deployment descriptor tools are provided. |
| private String | genericJarSuffix
Instance variable that stores the suffix for the generated jarfile. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addDeploymentTool(EJBDeploymentTool
a deployment tool instance to which descriptors
will be passed for processing. deploymentTool)Add a deployment tool to the list of deployment tools that will be processed |
| public BorlandDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for Borland server. |
| public Path | Returns: the path to be configured.Adds to the classpath used to locate the super classes and interfaces of the classes that will make up the EJB JAR. |
| public EjbJar. | |
| public IPlanetDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for iPlanet Application Server. |
| public JbossDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for JBoss server. |
| public JonasDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for JOnAS server. |
| public OrionDeploymentTool | Returns: the deployment tool instance to be configured.Create a orion nested element used to configure a deployment tool for Orion server. |
| public FileSet | Returns: a fileset which can be populated with support files.Adds a fileset for support elements. |
| public WeblogicDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for WebLogic server. |
| public WeblogicTOPLinkDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for WebLogic when using the TOPLink Object-Relational mapping. |
| public WebsphereDeploymentTool | Returns: the deployment tool instance to be configured.Adds a deployment tool for WebSphere 4.0 server. |
| public void | execute()
Overrides org. |
| public String | |
| public File | |
| public void | setBasejarname(String
the basename that will be used when writing the jar
file containing the EJB inValue)Set the base name of the EJB JAR that is to be created if it is not to be determined from the name of the deployment descriptor files. |
| public void | setBasenameterminator(String
a string which marks the end of the basename. inValue)The string which terminates the bean name. |
| public void | setClasspath(Path
the classpath to use. classpath)Set the classpath to use when resolving classes for inclusion in the jar. |
| public void | |
| public void | setDependency(String
the name of the dependency analyzer or a class. analyzer)Set the analyzer to use when adding in dependencies to the JAR. |
| public void | setDescriptordir(File
the directory containing the deployment descriptors. inDir)Set the descriptor directory. |
| public void | setDestdir(File
the destination directory in which to generate jars inDir)Set the destination directory. |
| public void | setFlatdestdir(boolean
the new value of the flatdestdir flag. inValue)Controls whether the destination JARs are written out in the destination directory with the same hierarchical structure from which the deployment descriptors have been read. |
| public void | setGenericjarsuffix(String
the string to use as the suffix. inString)Set the suffix for the generated jar file. |
| public void | setManifest(File
the manifest to be used in the EJB jar manifest)Set the Manifest file to use when jarring. |
| public void | setNaming(EjbJar.
the naming scheme to be used namingSchemeSet the naming scheme used to determine the name of the generated jars from the deployment descriptor |
| public void | |
| private void |
| cmpVersion | back to summary |
|---|---|
| private String cmpVersion Instance variable that stores the CMP version for the JBoss jarfile. | |
| config | back to summary |
|---|---|
| private EjbJar. The config which is built by this task and used by the various deployment tools to access the configuration of the ejbjar task | |
| deploymentTools | back to summary |
|---|---|
| private List<EJBDeploymentTool> deploymentTools The list of deployment tools we are going to run. | |
| destDir | back to summary |
|---|---|
| private File destDir Stores a handle to the directory to put the Jar files in. This is only used by the generic deployment descriptor tool which is created if no other deployment descriptor tools are provided. Normally each deployment tool will specify the destination dir itself. | |
| genericJarSuffix | back to summary |
|---|---|
| private String genericJarSuffix Instance variable that stores the suffix for the generated jarfile. | |
| EjbJar | back to summary |
|---|---|
| public EjbJar() | |
| addDeploymentTool | back to summary |
|---|---|
| protected void addDeploymentTool(EJBDeploymentTool deploymentTool) Add a deployment tool to the list of deployment tools that will be processed
| |
| createBorland | back to summary |
|---|---|
| public BorlandDeploymentTool createBorland() Adds a deployment tool for Borland server.
| |
| createClasspath | back to summary |
|---|---|
| public Path createClasspath() Adds to the classpath used to locate the super classes and interfaces of the classes that will make up the EJB JAR.
| |
| createDTD | back to summary |
|---|---|
| public EjbJar. Create a DTD location record. This stores the location of a DTD. The DTD is identified by its public Id. The location may either be a file location or a resource location.
| |
| createIplanet | back to summary |
|---|---|
| public IPlanetDeploymentTool createIplanet() Adds a deployment tool for iPlanet Application Server.
| |
| createJboss | back to summary |
|---|---|
| public JbossDeploymentTool createJboss() Adds a deployment tool for JBoss server.
| |
| createJonas | back to summary |
|---|---|
| public JonasDeploymentTool createJonas() Adds a deployment tool for JOnAS server.
| |
| createOrion | back to summary |
|---|---|
| public OrionDeploymentTool createOrion() Create a orion nested element used to configure a deployment tool for Orion server.
| |
| createSupport | back to summary |
|---|---|
| public FileSet createSupport() Adds a fileset for support elements.
| |
| createWeblogic | back to summary |
|---|---|
| public WeblogicDeploymentTool createWeblogic() Adds a deployment tool for WebLogic server.
| |
| createWeblogictoplink | back to summary |
|---|---|
| public WeblogicTOPLinkDeploymentTool createWeblogictoplink() Adds a deployment tool for WebLogic when using the TOPLink Object-Relational mapping.
| |
| createWebsphere | back to summary |
|---|---|
| public WebsphereDeploymentTool createWebsphere() Adds a deployment tool for WebSphere 4.0 server.
| |
| execute | back to summary |
|---|---|
| public void execute() throws BuildException Overrides org. Invoked by Ant after the task is prepared, when it is ready to execute this task. This will configure all of the nested deployment tools to allow them to process the jar. If no deployment tools have been configured a generic tool is created to handle the jar. A parser is configured and then each descriptor found is passed to all the deployment tool elements for processing.
| |
| getCmpversion | back to summary |
|---|---|
| public String getCmpversion() Gets the CMP version.
| |
| getDestdir | back to summary |
|---|---|
| public File getDestdir() Gets the destination directory.
| |
| setBasejarname | back to summary |
|---|---|
| public void setBasejarname(String inValue) Set the base name of the EJB JAR that is to be created if it is not to be determined from the name of the deployment descriptor files.
| |
| setBasenameterminator | back to summary |
|---|---|
| public void setBasenameterminator(String inValue) The string which terminates the bean name. The convention used by this task is that bean descriptors are named as the BeanName with some suffix. The baseNameTerminator string separates the bean name and the suffix and is used to determine the bean name.
| |
| setClasspath | back to summary |
|---|---|
| public void setClasspath(Path classpath) Set the classpath to use when resolving classes for inclusion in the jar.
| |
| setCmpversion | back to summary |
|---|---|
| public void setCmpversion(EjbJar. Sets the CMP version.
Must be either
| |
| setDependency | back to summary |
|---|---|
| public void setDependency(String analyzer) Set the analyzer to use when adding in dependencies to the JAR.
| |
| setDescriptordir | back to summary |
|---|---|
| public void setDescriptordir(File inDir) Set the descriptor directory. The descriptor directory contains the EJB deployment descriptors. These are XML files that declare the properties of a bean in a particular deployment scenario. Such properties include, for example, the transactional nature of the bean and the security access control to the bean's methods.
| |
| setDestdir | back to summary |
|---|---|
| public void setDestdir(File inDir) Set the destination directory. The EJB jar files will be written into this directory. The jar files that exist in this directory are also used when determining if the contents of the jar file have changed. Note that this parameter is only used if no deployment tools are specified. Typically each deployment tool will specify its own destination directory.
| |
| setFlatdestdir | back to summary |
|---|---|
| public void setFlatdestdir(boolean inValue) Controls whether the destination JARs are written out in the destination directory with the same hierarchical structure from which the deployment descriptors have been read. If this is set to true the generated EJB jars are written into the root of the destination directory, otherwise they are written out in the same relative position as the deployment descriptors in the descriptor directory.
| |
| setGenericjarsuffix | back to summary |
|---|---|
| public void setGenericjarsuffix(String inString) Set the suffix for the generated jar file. When generic jars are generated, they have a suffix which is appended to the the bean name to create the name of the jar file. Note that this suffix includes the extension fo te jar file and should therefore end with an appropriate extension such as .jar or .ear
| |
| setManifest | back to summary |
|---|---|
| public void setManifest(File manifest) Set the Manifest file to use when jarring. As of EJB 1.1, manifest files are no longer used to configure the EJB. However, they still have a vital importance if the EJB is intended to be packaged in an EAR file. By adding "Class-Path" settings to a Manifest file, the EJB can look for classes inside the EAR file itself, allowing for easier deployment. This is outlined in the J2EE specification, and all J2EE components are meant to support it.
| |
| setNaming | back to summary |
|---|---|
| public void setNaming(EjbJar. Set the naming scheme used to determine the name of the generated jars from the deployment descriptor
| |
| setSrcdir | back to summary |
|---|---|
| public void setSrcdir(File inDir) Sets the source directory, which is the directory that contains the classes that will be added to the EJB jar. Typically this will include the home and remote interfaces and the bean class.
| |
| validateConfig | back to summary |
|---|---|
| private void validateConfig() throws BuildException Validate the config that has been configured from the build file
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | CMP1_0
1.0 value |
| public static final String | CMP2_0
2.0 value |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | getValues()
Implements abstract org. |
| CMP1_0 | back to summary |
|---|---|
| public static final String CMP1_0 1.0 value | |
| CMP2_0 | back to summary |
|---|---|
| public static final String CMP2_0 2.0 value | |
| CMPVersion | back to summary |
|---|---|
| public CMPVersion() | |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Doc from org. This is the only method a subclass needs to implement.. | |
| Modifier and Type | Field and Description |
|---|---|
| public String | analyzer
The dependency analyzer to use to add additional classes to the jar |
| public String | baseJarName
Stores a handle to the destination EJB Jar file |
| public String | baseNameTerminator
Instance variable that marks the end of the 'basename' |
| public Path | classpath
The classpath to use when loading classes |
| public File | descriptorDir
Stores a handle to the directory under which to search for deployment descriptors |
| public ArrayList | dtdLocations
The list of configured DTD locations |
| public boolean | flatDestDir
Instance variable that determines whether to use a package structure of a flat directory as the destination for the jar files. |
| public File | manifest
The Manifest file |
| public EjbJar. | namingScheme
The naming scheme used to determine the generated jar name from the descriptor information |
| public File | srcDir
Stores a handle to the directory under which to search for class files |
| public List | supportFileSets
A Fileset of support classes |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| analyzer | back to summary |
|---|---|
| public String analyzer The dependency analyzer to use to add additional classes to the jar | |
| baseJarName | back to summary |
|---|---|
| public String baseJarName Stores a handle to the destination EJB Jar file | |
| baseNameTerminator | back to summary |
|---|---|
| public String baseNameTerminator Instance variable that marks the end of the 'basename' | |
| classpath | back to summary |
|---|---|
| public Path classpath The classpath to use when loading classes | |
| descriptorDir | back to summary |
|---|---|
| public File descriptorDir Stores a handle to the directory under which to search for deployment descriptors | |
| dtdLocations | back to summary |
|---|---|
| public ArrayList<EjbJar. The list of configured DTD locations | |
| flatDestDir | back to summary |
|---|---|
| public boolean flatDestDir Instance variable that determines whether to use a package structure of a flat directory as the destination for the jar files. | |
| manifest | back to summary |
|---|---|
| public File manifest The Manifest file | |
| namingScheme | back to summary |
|---|---|
| public EjbJar. The naming scheme used to determine the generated jar name from the descriptor information | |
| srcDir | back to summary |
|---|---|
| public File srcDir Stores a handle to the directory under which to search for class files | |
| supportFileSets | back to summary |
|---|---|
| public List<FileSet> supportFileSets A Fileset of support classes | |
| Config | back to summary |
|---|---|
| pack-priv Config() | |
| Access | Constructor and Description |
|---|---|
| public |
| DTDLocation | back to summary |
|---|---|
| public DTDLocation() | |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | BASEJARNAME
Naming scheme where the generated jar is named by the basejarname attribute |
| public static final String | DESCRIPTOR
Naming scheme where the generated jar name is based on the name of the deployment descriptor file |
| public static final String | DIRECTORY
Naming scheme where the generated jar name is based on the name of the directory containing the deployment descriptor |
| public static final String | EJB_NAME
Naming scheme where generated jar is determined from the ejb-name in the deployment descriptor |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public String[] | Returns: an array of the values of this attribute class.Implements abstract org. |
| BASEJARNAME | back to summary |
|---|---|
| public static final String BASEJARNAME Naming scheme where the generated jar is named by the basejarname attribute | |
| DESCRIPTOR | back to summary |
|---|---|
| public static final String DESCRIPTOR Naming scheme where the generated jar name is based on the name of the deployment descriptor file | |
| DIRECTORY | back to summary |
|---|---|
| public static final String DIRECTORY Naming scheme where the generated jar name is based on the name of the directory containing the deployment descriptor | |
| EJB_NAME | back to summary |
|---|---|
| public static final String EJB_NAME Naming scheme where generated jar is determined from the ejb-name in the deployment descriptor | |
| NamingScheme | back to summary |
|---|---|
| public NamingScheme() | |
| getValues | back to summary |
|---|---|
| public String[] getValues() Implements abstract org. Gets the values of the NamingScheme | |