IPlanetEjbcTask (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.taskdefs.optional.ejb, class: IPlanetEjbcTask

# Class IPlanetEjbcTask

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbcTask

All Implemented Interfaces:
  `Cloneable`

public class IPlanetEjbcTask extends Task
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:

- ejbdescriptor -- Standard EJB 1.1 XML descriptor (typically titled "ejb-jar.xml"). This attribute is required.
- iasdescriptor -- EJB XML descriptor for iPlanet Application Server (typically titled "ias-ejb-jar.xml). This attribute is required.
- dest -- The is the base directory where the RMI stubs and skeletons are written. In addition, the class files for each bean (home interface, remote interface, and EJB implementation) must be found in this directory. This attribute is required.
- classpath -- The classpath used when generating EJB stubs and skeletons. This is an optional attribute (if omitted, the classpath specified when Ant was started will be used). Nested "classpath" elements may also be used.
- keepgenerated -- Indicates whether or not the Java source files which are generated by ejbc will be saved or automatically deleted. If "yes", the source files will be retained. This is an optional attribute (if omitted, it defaults to "no").
- debug -- Indicates whether or not the ejbc utility should log additional debugging statements to the standard output. If "yes", the additional debugging statements will be generated (if omitted, it defaults to "no").
- iashome -- May be used to specify the "home" directory for this iPlanet Application Server installation. This is used to find the ejbc utility if it isn't included in the user's system path. This is an optional attribute (if specified, it should refer to the `[install-location]/iplanet/ias6/ias` directory). If omitted, the ejbc utility must be on the user's system path.

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

  ### Fields inherited from class Task

  `target, taskName, taskType, wrapper`
  Modifier and Type
  Field
  Description
  `protected Target`
  `target`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskName`
  Deprecated.
  since 1.6.x.
  `protected String`
  `taskType`
  Deprecated.
  since 1.6.x.
  `protected RuntimeConfigurable`
  `wrapper`
  Deprecated.
  since 1.6.x.

  ### Fields inherited from class ProjectComponent

  `description, location, project`
  Modifier and Type
  Field
  Description
  `protected String`
  `description`
  Deprecated.
  since 1.6.x.
  `protected Location`
  `location`
  Deprecated.
  since 1.6.x.
  `protected Project`
  `project`
  Deprecated.
  since 1.6.x.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IPlanetEjbcTask()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Path`
  `createClasspath()`
  Adds to the classpath used when compiling the EJB stubs and skeletons.
  `void`
  `execute()`
  Does the work.
  `void`
  `setClasspath(Path classpath)`
  Sets the classpath to be used when compiling the EJB stubs and skeletons.
  `void`
  `setDebug(boolean debug)`
  If true, debugging output will be generated when ejbc is executed.
  `void`
  `setDest(File dest)`
  Sets the destination directory where the EJB source classes must exist and where the stubs and skeletons will be written.
  `void`
  `setEjbdescriptor(File ejbdescriptor)`
  Sets the location of the standard XML EJB descriptor.
  `void`
  `setIasdescriptor(File iasdescriptor)`
  Sets the location of the iAS-specific XML EJB descriptor.
  `void`
  `setIashome(File iashome)`
  May be used to specify the "home" directory for this iAS installation.
  `void`
  `setKeepgenerated(boolean keepgenerated)`
  If true, the Java source files which are generated by ejbc will be saved .

  ### Methods inherited from class Task

  `bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType`
  Modifier and Type
  Method
  Description
  `final void`
  `bindToOwner(Task owner)`
  Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
  `Target`
  `getOwningTarget()`
  Returns the container target of this task.
  `RuntimeConfigurable`
  `getRuntimeConfigurableWrapper()`
  Returns the wrapper used for runtime configuration.
  `String`
  `getTaskName()`
  Returns the name to use in logging messages.
  `String`
  `getTaskType()`
  Return the type of task.
  `protected RuntimeConfigurable`
  `getWrapper()`
  Return the runtime configurable structure for this task.
  `protected void`
  `handleErrorFlush(String output)`
  Handles an error line by logging it with the WARN priority.
  `protected void`
  `handleErrorOutput(String output)`
  Handles an error output by logging it with the WARN priority.
  `protected void`
  `handleFlush(String output)`
  Handles output by logging it with the INFO priority.
  `protected int`
  `handleInput(byte[] buffer, int offset, int length)`
  Handle an input request by this task.
  `protected void`
  `handleOutput(String output)`
  Handles output by logging it with the INFO priority.
  `void`
  `init()`
  Called by the project to let the task initialize properly.
  `protected final boolean`
  `isInvalid()`
  Has this task been marked invalid?
  `void`
  `log(String msg)`
  Logs a message with the default (INFO) priority.
  `void`
  `log(String msg, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(String msg, Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `log(Throwable t, int msgLevel)`
  Logs a message with the given priority.
  `void`
  `maybeConfigure()`
  Configures this task - if it hasn't been done already.
  `final void`
  `perform()`
  Performs this task if it's still valid, or gets a replacement version and performs that otherwise.
  `void`
  `reconfigure()`
  Force the task to be reconfigured from its RuntimeConfigurable.
  `void`
  `setOwningTarget(Target target)`
  Sets the target container of this task.
  `void`
  `setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)`
  Sets the wrapper to be used for runtime configuration.
  `void`
  `setTaskName(String name)`
  Sets the name to use in logging messages.
  `void`
  `setTaskType(String type)`
  Sets the name with which the task has been invoked.

  ### Methods inherited from class ProjectComponent

  `clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject`
  Modifier and Type
  Method
  Description
  `Object`
  `clone()`
  `String`
  `getDescription()`
  Returns the description of the current action.
  `Location`
  `getLocation()`
  Returns the file/location where this task was defined.
  `Project`
  `getProject()`
  Returns the project to which this component belongs.
  `void`
  `setDescription(String desc)`
  Sets a description of the current action.
  `void`
  `setLocation(Location location)`
  Sets the file/location where this task was defined.
  `void`
  `setProject(Project project)`
  Sets the project object of this component.

  ### Methods inherited from class Object

  `equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### IPlanetEjbcTask

    public IPlanetEjbcTask()

- ## Method Details

  - ### setEjbdescriptor

    public void setEjbdescriptor(File ejbdescriptor)
    Sets the location of the standard XML EJB descriptor. Typically, this file is named "ejb-jar.xml".
    Parameters:
      `ejbdescriptor` - The name and location of the EJB descriptor.

  - ### setIasdescriptor

    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` - The name and location of the iAS-specific EJB descriptor.

  - ### setDest

    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` - The directory where the compiled classes will be written.

  - ### setClasspath

    public void setClasspath(Path classpath)
    Sets the classpath to be used when compiling the EJB stubs and skeletons.
    Parameters:
      `classpath` - The classpath to be used.

  - ### createClasspath

    public Path createClasspath()
    Adds to the classpath used when compiling the EJB stubs and skeletons.
    Returns:
      the class path.

  - ### setKeepgenerated

    public void setKeepgenerated(boolean keepgenerated)
    If true, the Java source files which are generated by ejbc will be saved .
    Parameters:
      `keepgenerated` - A boolean indicating if the Java source files for the stubs and skeletons should be retained.

  - ### setDebug

    public void setDebug(boolean debug)
    If true, debugging output will be generated when ejbc is executed.
    Parameters:
      `debug` - A boolean indicating if debugging output should be generated

  - ### setIashome

    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` - The home directory for the user's iAS installation.

  - ### execute

    public void execute() throws BuildException
    Does the work.
    Overrides:
      `execute` in class `Task`
    Throws:
      `BuildException` - if there is a problem.