Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs.optional.ejb

public Class IPlanetEjbcTask

extends Task
Class Inheritance
Imports
java.io.File, .IOException, javax.xml.parsers.ParserConfigurationException, .SAXParser, .SAXParserFactory, org.apache.tools.ant.BuildException, .Task, org.apache.tools.ant.types.Path, org.xml.sax.SAXException

Compiles EJB stubs and skeletons for the iPlanet Application Server. The EJBs to be processed are specified by the EJB 1.1 standard XML descriptor, and additional attributes are obtained from the iPlanet Application Server-specific XML descriptor. Since the XML descriptors can include multiple EJBs, this is a convenient way of specifying many EJBs in a single Ant task. The following attributes are allowed:

For each EJB specified, this task will locate the three classes that comprise the EJB. If these class files cannot be located in the dest directory, the task will fail. The task will also attempt to locate the EJB stubs and skeletons in this directory. If found, the timestamps on the stubs and skeletons will be checked to ensure they are up to date. Only if these files cannot be found or if they are out of date will ejbc be called to generate new stubs and skeletons.

See Also
IPlanetEjbc

Field Summary

Modifier and TypeField and Description
private Path
private boolean
private File
private File
private File
private File
private boolean
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkConfiguration()

Verifies that the user selections are valid.

public Path

Returns:

the class path.
createClasspath
()

Adds to the classpath used when compiling the EJB stubs and skeletons.

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Does the work.
private void
executeEjbc(SAXParser
SAXParser that may be used to process the EJB descriptors
saxParser
)

Executes the EJBc utility using the SAXParser provided.

private Path

Returns:

Path The classpath to be used for EJBc.
getClasspath
()

Returns the CLASSPATH to be used when calling EJBc.

private SAXParser

Returns:

Parser which may be used to process the EJB descriptors.
getParser
()

Returns a SAXParser that may be used to process the XML descriptors.

public void
setClasspath(Path
The classpath to be used.
classpath
)

Sets the classpath to be used when compiling the EJB stubs and skeletons.

public void
setDebug(boolean
A boolean indicating if debugging output should be generated
debug
)

If true, debugging output will be generated when ejbc is executed.

public void
setDest(File
The directory where the compiled classes will be written.
dest
)

Sets the destination directory where the EJB source classes must exist and where the stubs and skeletons will be written.

public void
setEjbdescriptor(File
The name and location of the EJB descriptor.
ejbdescriptor
)

Sets the location of the standard XML EJB descriptor.

public void
setIasdescriptor(File
The name and location of the iAS-specific EJB descriptor.
iasdescriptor
)

Sets the location of the iAS-specific XML EJB descriptor.

public void
setIashome(File
The home directory for the user's iAS installation.
iashome
)

May be used to specify the "home" directory for this iAS installation.

public void
setKeepgenerated(boolean
A boolean indicating if the Java source files for the stubs and skeletons should be retained.
keepgenerated
)

If true, the Java source files which are generated by ejbc will be saved .

Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

classpathback to summary
private Path classpath
debugback to summary
private boolean debug
destback to summary
private File dest
ejbdescriptorback to summary
private File ejbdescriptor
iasdescriptorback to summary
private File iasdescriptor
iashomeback to summary
private File iashome
keepgeneratedback to summary
private boolean keepgenerated

Constructor Detail

IPlanetEjbcTaskback to summary
public IPlanetEjbcTask()

Method Detail

checkConfigurationback to summary
private void checkConfiguration() throws BuildException

Verifies that the user selections are valid.

Exceptions
BuildException:
If the user selections are invalid.
createClasspathback to summary
public Path createClasspath()

Adds to the classpath used when compiling the EJB stubs and skeletons.

Returns:Path

the class path.

executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Does the work.

Annotations
@Override
Exceptions
BuildException:
if there is a problem.
executeEjbcback to summary
private void executeEjbc(SAXParser saxParser) throws BuildException

Executes the EJBc utility using the SAXParser provided.

Parameters
saxParser:SAXParser

SAXParser that may be used to process the EJB descriptors

Exceptions
BuildException:
If there is an error reading or parsing the XML descriptors
getClasspathback to summary
private Path getClasspath()

Returns the CLASSPATH to be used when calling EJBc. If no user CLASSPATH is specified, the System classpath is returned instead.

Returns:Path

Path The classpath to be used for EJBc.

getParserback to summary
private SAXParser getParser() throws BuildException

Returns a SAXParser that may be used to process the XML descriptors.

Returns:SAXParser

Parser which may be used to process the EJB descriptors.

Exceptions
BuildException:
If the parser cannot be created or configured.
setClasspathback to summary
public void setClasspath(Path classpath)

Sets the classpath to be used when compiling the EJB stubs and skeletons.

Parameters
classpath:Path

The classpath to be used.

setDebugback to summary
public void setDebug(boolean debug)

If true, debugging output will be generated when ejbc is executed.

Parameters
debug:boolean

A boolean indicating if debugging output should be generated

setDestback to summary
public void setDest(File dest)

Sets the destination directory where the EJB source classes must exist and where the stubs and skeletons will be written. The destination directory must exist before this task is executed.

Parameters
dest:File

The directory where the compiled classes will be written.

setEjbdescriptorback to summary
public void setEjbdescriptor(File ejbdescriptor)

Sets the location of the standard XML EJB descriptor. Typically, this file is named "ejb-jar.xml".

Parameters
ejbdescriptor:File

The name and location of the EJB descriptor.

setIasdescriptorback to summary
public void setIasdescriptor(File iasdescriptor)

Sets the location of the iAS-specific XML EJB descriptor. Typically, this file is named "ias-ejb-jar.xml".

Parameters
iasdescriptor:File

The name and location of the iAS-specific EJB descriptor.

setIashomeback to summary
public void setIashome(File iashome)

May be used to specify the "home" directory for this iAS installation. The directory specified should typically be [install-location]/iplanet/ias6/ias.

Parameters
iashome:File

The home directory for the user's iAS installation.

setKeepgeneratedback to summary
public void setKeepgenerated(boolean keepgenerated)

If true, the Java source files which are generated by ejbc will be saved .

Parameters
keepgenerated:boolean

A boolean indicating if the Java source files for the stubs and skeletons should be retained.