Class BorlandDeploymentTool
java.lang.Object
org.apache.tools.ant.taskdefs.optional.ejb.GenericDeploymentTool
org.apache.tools.ant.taskdefs.optional.ejb.BorlandDeploymentTool
- All Implemented Interfaces:
ExecuteStreamHandler, EJBDeploymentTool
BorlandDeploymentTool is dedicated to the Borland Application Server 4.5 and 4.5.1
This task generates and compiles the stubs and skeletons for all ejb described into the
Deployment Descriptor, builds the jar file including the support files and verify
whether the produced jar is valid or not.
The supported options are:
- debug (boolean) : turn on the debug mode for generation of stubs and skeletons (default:false)
- verify (boolean) : turn on the verification at the end of the jar production (default:true)
- verifyargs (String) : add optional argument to verify command (see vbj com.inprise.ejb.util.Verify)
- basdtd (String) : location of the BAS DTD
- generateclient (boolean) : turn on the client jar file generation
- version (int) : tell what is the Borland appserver version 4 or 5
<ejbjar srcdir="${build.classes}"
basejarname="vsmp"
descriptordir="${rsc.dir}/hrmanager">
<borland destdir="tstlib">
<classpath refid="classpath" />
</borland>
<include name="**\ejb-jar.xml"/>
<support dir="${build.classes}">
<include name="demo\smp\*.class"/>
<include name="demo\helper\*.class"/>
</support>
</ejbjar>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringJava2iiop executablestatic final StringBorland 1.1 ejb idprotected static final StringVerify classFields inherited from class GenericDeploymentTool
ANALYZER_CLASS_FULL, ANALYZER_CLASS_SUPER, ANALYZER_FULL, ANALYZER_NONE, ANALYZER_SUPER, DEFAULT_ANALYZER, DEFAULT_BUFFER_SIZE, EJB_DD, JAR_COMPRESS_LEVEL, MANIFEST, META_DIRModifier and TypeFieldDescriptionstatic final StringThe analyzer class for the super analyzerstatic final StringThe analyzer class for the super analyzerstatic final StringA dependency analyzer name to find all related classesstatic final StringA dependency analyzer name for no analyzerstatic final StringA dependency analyzer name to find ancestor classesstatic final StringThe default analyzerstatic final intThe default buffer byte size to use for IOprotected static final StringName for EJB Deployment descriptor within EJB jarsstatic final intThe level to use for compressionprotected static final StringThe standard MANIFEST fileprotected static final StringThe standard META-INF directory in jar files -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddVendorFiles(Hashtable<String, File> ejbFiles, String ddPrefix) Add any vendor specific files which should be included in the EJB Jar.protected DescriptorHandlergetBorlandDescriptorHandler(File srcDir) Get the borland descriptor handler.voidSetter used to store the location of the borland DTD.voidsetDebug(boolean debug) set the debug mode for java2iiop (default false)voidsetGenerateclient(boolean b) setter used to store whether the task will include the generate client task.voidsetJava2iiopParams(String params) If filled, the params are added to the java2iiop command.voidSet the error stream of the process.voidsetProcessInputStream(OutputStream param1) Install a handler for the input stream of the subprocess.voidSet the output stream of the process.voidSetter used to store the suffix for the generated borland jar file.voidsetVerify(boolean verify) set the verify mode for the produced jar (default true)voidsetVerifyArgs(String args) sets some additional args to send to verify commandvoidsetVersion(int version) setter used to store the borland appserver version [4 or 5]voidstart()Start handling of the streams.voidstop()Stop handling of the streams - will not be restarted.protected voidMethod used to encapsulate the writing of the JAR file.Methods inherited from class GenericDeploymentTool
addFileToJar, addSupportClasses, checkAndAddDependants, checkConfiguration, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDescriptorHandler, getDestDir, getJarBaseName, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, processDescriptor, registerKnownDTDs, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName, validateConfiguredModifier and TypeMethodDescriptionprotected voidaddFileToJar(JarOutputStream jStream, File inputFile, String logicalFilename) Utility method that encapsulates the logic of adding a file entry to a .jar file.protected voidaddSupportClasses(Hashtable<String, File> ejbFiles) Adds any classes the user specifies using support nested elements to theejbFilesHashtable.protected voidcheckAndAddDependants(Hashtable<String, File> checkEntries) Add all available classes, that depend on Remote, Home, Bean, PKprotected voidcheckConfiguration(String descriptorFileName, SAXParser saxParser) This method is called as the first step in the processDescriptor method to allow vendor-specific subclasses to validate the task configuration prior to processing the descriptor.voidconfigure(org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.Config config) Configure this tool for use in the ejbjar task.Add the classpath for the user classesprotected ClassLoaderReturns a Classloader object which parses the passed in generic EjbJar classpath.protected PathGet the classpath by combining the one from the surrounding task, if any and the one from this tool.protected org.apache.tools.ant.taskdefs.optional.ejb.EjbJar.ConfigGet the basename terminator.protected DescriptorHandlergetDescriptorHandler(File srcDir) Get a descriptionHandler.protected FileGet the destination directory.protected StringgetJarBaseName(String descriptorFileName) Using the EJB descriptor file name passed from theejbjartask, this method returns the "basename" which will be used to name the completed JAR file.protected LocationGet the build file location associated with this element's task.protected FilegetManifestFile(String prefix) Get the manifest file to use for building the generic jar.protected StringReturns the Public ID of the DTD specified in the EJB descriptor.protected TaskgetTask()Get the task for this tool.getVendorDDPrefix(String baseName, String descriptorFileName) Get the prefix for vendor deployment descriptors.protected voidLog a message to the Ant output.protected booleanneedToRebuild(Hashtable<String, File> ejbFiles, File jarFile) This method checks the timestamp on each file listed in theejbFilesand compares them to the timestamp on thejarFile.parseEjbFiles(String descriptorFileName, SAXParser saxParser) This method returns a list of EJB files found when the specified EJB descriptor is parsed and processed.voidprocessDescriptor(String descriptorFileName, SAXParser saxParser) Process a deployment descriptor, generating the necessary vendor specific deployment files.protected voidregisterKnownDTDs(DescriptorHandler handler) Register the locations of all known DTDs.voidsetClasspath(Path classpath) Set the classpath to be used for this compilation.voidsetDestdir(File inDir) Set the destination directory; required.voidsetGenericJarSuffix(String inString) Set the suffix for the generated jar file.voidSet the task which owns this toolprotected booleanIndicate if this build is using the base jar name.voidCalled to validate that the tool parameters have been configured.
-
Field Details
-
PUBLICID_BORLAND_EJB
-
DEFAULT_BAS45_EJB11_DTD_LOCATION
- See Also:
-
DEFAULT_BAS_DTD_LOCATION
- See Also:
-
BAS_DD
- See Also:
-
BES_DD
- See Also:
-
JAVA2IIOP
-
VERIFY
-
-
Constructor Details
-
BorlandDeploymentTool
public BorlandDeploymentTool()
-
-
Method Details
-
setDebug
public void setDebug(boolean debug) set the debug mode for java2iiop (default false)- Parameters:
debug- the setting to use.
-
setVerify
public void setVerify(boolean verify) set the verify mode for the produced jar (default true)- Parameters:
verify- the setting to use.
-
setSuffix
Setter used to store the suffix for the generated borland jar file.- Parameters:
inString- the string to use as the suffix.
-
setVerifyArgs
sets some additional args to send to verify command- Parameters:
args- additional command line parameters
-
setBASdtd
Setter used to store the location of the borland DTD. This can be a file on the system or a resource on the classpath.- Parameters:
inString- the string to use as the DTD location.
-
setGenerateclient
public void setGenerateclient(boolean b) setter used to store whether the task will include the generate client task. (see : BorlandGenerateClient task)- Parameters:
b- if true generate the client task.
-
setVersion
public void setVersion(int version) setter used to store the borland appserver version [4 or 5]- Parameters:
version- app server version 4 or 5
-
setJava2iiopParams
If filled, the params are added to the java2iiop command. (ex: -no_warn_missing_define)- Parameters:
params- additional params for java2iiop
-
getBorlandDescriptorHandler
Get the borland descriptor handler.- Parameters:
srcDir- the source directory.- Returns:
- the descriptor.
-
addVendorFiles
Add any vendor specific files which should be included in the EJB Jar.- Overrides:
addVendorFilesin classGenericDeploymentTool- Parameters:
ejbFiles- the map to add the files to.ddPrefix- the prefix to use.
-
writeJar
protected void writeJar(String baseName, File jarFile, Hashtable<String, File> files, String publicId) throws BuildExceptionMethod used to encapsulate the writing of the JAR file. Iterates over the filenames/java.io.Files in the Hashtable stored on the instance variable ejbFiles.- Overrides:
writeJarin classGenericDeploymentTool- Parameters:
baseName- the base name.jarFile- the jar file to write to.files- the files to write to the jar.publicId- the id to use.- Throws:
BuildException- if there is an error.
-
start
Start handling of the streams..- Specified by:
startin interfaceExecuteStreamHandler- Throws:
IOException- on error
-
stop
public void stop()Stop handling of the streams - will not be restarted..- Specified by:
stopin interfaceExecuteStreamHandler
-
setProcessInputStream
Install a handler for the input stream of the subprocess..- Specified by:
setProcessInputStreamin interfaceExecuteStreamHandler- Parameters:
param1- output stream to write to the standard input stream of the subprocess- Throws:
IOException- on error
-
setProcessOutputStream
Set the output stream of the process.- Specified by:
setProcessOutputStreamin interfaceExecuteStreamHandler- Parameters:
is- the input stream.- Throws:
IOException- if there is an error.
-
setProcessErrorStream
Set the error stream of the process.- Specified by:
setProcessErrorStreamin interfaceExecuteStreamHandler- Parameters:
is- the input stream.- Throws:
IOException- if there is an error.
-