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

public Class IPlanetEjbc

extends Object
Class Inheritance
Imports
java.io.BufferedReader, .File, .IOException, .InputStream, .InputStreamReader, java.nio.file.Files, .Paths, java.time.Instant, java.util.ArrayList, .Collection, .Collections, .HashMap, .Hashtable, .List, .Map, .Properties, .StringTokenizer, java.util.stream.Stream, javax.xml.parsers.SAXParser, .SAXParserFactory, org.apache.tools.ant.util.StringUtils, org.xml.sax.AttributeList, .HandlerBase, .InputSource, .SAXException

Compiles EJB stubs and skeletons for the iPlanet Application Server (iAS). The class will read a standard EJB descriptor (as well as an EJB descriptor specific to iPlanet Application Server) to identify one or more EJBs to process. It will search for EJB "source" classes (the remote ; * interface, home interface, and EJB implementation class) and the EJB stubs and skeletons in the specified destination directory. Only if the stubs and skeletons cannot be found or if they're out of date will the iPlanet Application Server ejbc utility be run.

Because this class (and it's assorted inner classes) may be bundled into the iPlanet Application Server distribution at some point (and removed from the Ant distribution), the class has been written to be independent of all Ant-specific classes. It is also for this reason (and to avoid cluttering the Apache Ant source files) that this utility has been packaged into a single source file.

For more information on Ant Tasks for iPlanet Application Server, see the IPlanetDeploymentTool and IPlanetEjbcTask classes.

See Also
IPlanetDeploymentTool, IPlanetEjbcTask

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
IPlanetEjbc.Classname

Convenience class used to represent the fully qualified name of a Java class.

public class
IPlanetEjbc.EjbcException

This inner class is used to signal any problems during the execution of the ejbc compiler.

private class
IPlanetEjbc.EjbcHandler

Deprecated as a consequence of HandlerBase being deprecated.
This inner class is an XML document handler that can be used to parse EJB descriptors (both the standard EJB descriptor as well as the iAS-specific descriptor that stores additional values for iAS).
private class
IPlanetEjbc.EjbInfo

This inner class represents an EJB that will be compiled using ejbc.

private static class
IPlanetEjbc.RedirectOutput

Thread class used to redirect output from an InputStream to the JRE standard output.

Field Summary

Modifier and TypeField and Description
private String
private String[]
private boolean
private File
private String
private Hashtable<String, File>
private static final String
private IPlanetEjbc.EjbcHandler
handler

Deprecated as a consequence of IPlanetEjbc.EjbcHandler being deprecated.
private File
private File
private static final int
private static final int
private static final int
private static final int
private SAXParser
private boolean
private static final String
private static final String
private File

Constructor Summary

AccessConstructor and Description
public
IPlanetEjbc(File
File referencing a standard EJB descriptor.
stdDescriptor
,
File
File referencing an iAS-specific EJB descriptor.
iasDescriptor
,
File
File referencing the base directory where both EJB "source" files are found and where stubs and skeletons will be written.
destDirectory
,
String
String representation of the classpath to be used by the iAS ejbc utility.
classpath
,
SAXParser
SAXParser to be used to process both of the EJB descriptors.
parser
)

Constructs an instance which may be used to process EJB descriptors and generate EJB stubs and skeletons, if needed.

Method Summary

Modifier and TypeMethod and Description
private String[]

Returns:

An array of Strings which are the command-line parameters for for the ejbc utility.
buildArgumentList
(IPlanetEjbc.EjbInfo
The EJB for which stubs and skeletons will be compiled.
ejb
)

Based on this object's instance variables as well as the EJB to be processed, the correct flags and parameters are set for the ejbc command-line utility.

private void
callEjbc(String[]
Command line arguments to be passed to the ejbc utility.
arguments
)

Executes the iPlanet Application Server ejbc command-line utility.

protected void
checkConfiguration()

Verifies that the user selections are valid.

public void
execute()

Compiles the stub and skeletons for the specified EJBs, if they need to be updated.

public String[]

Returns:

An array of CMP descriptors.
getCmpDescriptors
()

Returns the list of CMP descriptors referenced in the EJB descriptors.

public String

Returns:

The EJB-JAR display name.
getDisplayName
()

Returns the display-name element read from the standard EJB descriptor.

public Hashtable<String, File>

Returns:

The list of EJB files processed by the ejbc utility.
getEjbFiles
()

Returns a Hashtable which contains a list of EJB class files processed by the ejbc utility (both "source" class files as well as stubs and skeletons).

private IPlanetEjbc.EjbInfo[]

Returns:

An array of objects which describe the EJBs to be processed.
getEjbs
()

Parses the EJB descriptors and returns a list of EJBs which may need to be compiled.

private void
log(String
The String to print to standard output.
msg
)

Convenience method used to print messages to the user if debugging messages are enabled.

public static void
main(String[]
The commandline arguments passed to the application.
args
)

Main application method for the iPlanet Application Server ejbc utility.

public void
registerDTD(String
The public DTD identifier found in an XML document.
publicID
,
String
The file or resource name for the appropriate DTD stored on the local machine.
location
)

Registers the location of a local DTD file or resource.

public void
setDebugOutput(boolean
A boolean indicating if debugging output should be generated
debugOutput
)

If true, enables debugging output when ejbc is executed.

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

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

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

If true, the Java source files which are generated by the ejbc process are retained.

private static void
usage()

Print a usage statement.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait