org.objectweb.jonas.ant.EjbJar Class Reference

List of all members.

Public Member Functions

JonasDeploymentTool createJonas ()
Path createClasspath ()
DTDLocation createDTD ()
FileSet createSupport ()
void setManifest (File manifest)
void setSrcdir (File inDir)
void setDescriptordir (File inDir)
void setDependency (String analyzer)
void setBasejarname (String inValue)
void setNaming (NamingScheme namingScheme)
File getDestdir ()
void setDestdir (File inDir)
String getCmpversion ()
void setCmpversion (CMPVersion version)
void setClasspath (Path classpath)
void setFlatdestdir (boolean inValue)
void setGenericjarsuffix (String inString)
void setBasenameterminator (String inValue)
void execute () throws BuildException

Protected Member Functions

void addDeploymentTool (EJBDeploymentTool deploymentTool)

Detailed Description

Provides automated EJB JAR file creation.

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.

Author:
Tim Fennell

Conor MacNeill

Rob van Oostrum

Definition at line 96 of file EjbJar.java.


Member Function Documentation

void org.objectweb.jonas.ant.EjbJar.addDeploymentTool EJBDeploymentTool  deploymentTool  )  [protected]
 

Add a deployment tool to the list of deployment tools that will be processed

Parameters:
deploymentTool a deployment tool instance to which descriptors will be passed for processing.

Definition at line 251 of file EjbJar.java.

Referenced by org.objectweb.jonas.ant.EjbJar.createJonas().

Path org.objectweb.jonas.ant.EjbJar.createClasspath  ) 
 

Adds to the classpath used to locate the super classes and interfaces of the classes that will make up the EJB JAR.

Returns:
the path to be configured.

Definition at line 275 of file EjbJar.java.

DTDLocation org.objectweb.jonas.ant.EjbJar.createDTD  ) 
 

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.

Returns:
the DTD location object to be configured by Ant

Definition at line 289 of file EjbJar.java.

JonasDeploymentTool org.objectweb.jonas.ant.EjbJar.createJonas  ) 
 

Adds a deployment tool for JOnAS server.

Returns:
the deployment tool instance to be configured.

Definition at line 261 of file EjbJar.java.

References org.objectweb.jonas.ant.EjbJar.addDeploymentTool().

Here is the call graph for this function:

FileSet org.objectweb.jonas.ant.EjbJar.createSupport  ) 
 

Adds a fileset for support elements.

Returns:
a fileset which can be populated with support files.

Definition at line 301 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.execute  )  throws BuildException
 

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.

Exceptions:
BuildException thrown whenever a problem is encountered that cannot be recovered from, to signal to ant that a major problem occurred within this task.

Definition at line 527 of file EjbJar.java.

References org.objectweb.jonas.ant.GenericDeploymentTool.configure(), org.objectweb.jonas.ant.GenericDeploymentTool.processDescriptor(), org.objectweb.jonas.ant.GenericDeploymentTool.setDestdir(), org.objectweb.jonas.ant.GenericDeploymentTool.setGenericJarSuffix(), org.objectweb.jonas.ant.GenericDeploymentTool.setTask(), and org.objectweb.jonas.ant.GenericDeploymentTool.validateConfigured().

Here is the call graph for this function:

String org.objectweb.jonas.ant.EjbJar.getCmpversion  ) 
 

Gets the CMP version.

Returns:
CMP version
Since:
ant 1.6

Definition at line 421 of file EjbJar.java.

File org.objectweb.jonas.ant.EjbJar.getDestdir  ) 
 

Gets the destination directory.

Returns:
destination directory
Since:
ant 1.6

Definition at line 397 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inValue the basename that will be used when writing the jar file containing the EJB

Definition at line 363 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inValue a string which marks the end of the basename.

Definition at line 484 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.setClasspath Path  classpath  ) 
 

Set the classpath to use when resolving classes for inclusion in the jar.

Parameters:
classpath the classpath to use.

Definition at line 443 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.setCmpversion CMPVersion  version  ) 
 

Sets the CMP version.

Parameters:
version CMP version. Must be either 1.0 or 2.0.<br/> Default is 1.0.<br/> Initially, only the JBoss implementation does something specific for CMP 2.0.<br/>
Since:
ant 1.6

Definition at line 434 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.setDependency String  analyzer  ) 
 

Set the analyzer to use when adding in dependencies to the JAR.

Parameters:
analyzer the name of the dependency analyzer or a class.

Definition at line 352 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inDir the directory containing the deployment descriptors.

Definition at line 343 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inDir the destination directory in which to generate jars

Definition at line 411 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inValue the new value of the flatdestdir flag.

Definition at line 458 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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

Parameters:
inString the string to use as the suffix.

Definition at line 471 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
manifest the manifest to be used in the EJB jar

Definition at line 319 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.setNaming NamingScheme  namingScheme  ) 
 

Set the naming scheme used to determine the name of the generated jars from the deployment descriptor

Parameters:
namingScheme the naming scheme to be used

Definition at line 381 of file EjbJar.java.

void org.objectweb.jonas.ant.EjbJar.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.

Parameters:
inDir the source directory.

Definition at line 330 of file EjbJar.java.


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:06:07 2005 for JOnAS by  doxygen 1.3.9.1