public class WebsphereDeploymentTool extends GenericDeploymentTool
deployment
. This step can be performed by the websphere
element as part of the jar generation process. If the switch
ejbdeploy
is on, the ejbdeploy tool from the websphere toolset
is called for every ejb-jar. Unfortunately, this step only works, if you
use the ibm jdk. Otherwise, the rmic (called by ejbdeploy) throws a
ClassFormatError. Be sure to switch ejbdeploy off, if run ant with
sun jdk.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PUBLICID_EJB11
ID for ejb 1.1
|
static java.lang.String |
PUBLICID_EJB20
ID for ejb 2.0
|
protected static java.lang.String |
SCHEMA_DIR
Schema directory
|
protected static java.lang.String |
WAS_BND |
protected static java.lang.String |
WAS_CMP_MAP |
protected static java.lang.String |
WAS_CMP_SCHEMA |
protected static java.lang.String |
WAS_EXT |
ANALYZER_CLASS_FULL, ANALYZER_CLASS_SUPER, ANALYZER_FULL, ANALYZER_NONE, ANALYZER_SUPER, DEFAULT_ANALYZER, DEFAULT_BUFFER_SIZE, EJB_DD, JAR_COMPRESS_LEVEL, MANIFEST, META_DIR
Constructor and Description |
---|
WebsphereDeploymentTool() |
Modifier and Type | Method and Description |
---|---|
protected void |
addVendorFiles(java.util.Hashtable ejbFiles,
java.lang.String baseName)
Add any vendor specific files which should be included in the EJB Jar.
|
Path |
createWASClasspath()
Get the classpath to the websphere classpaths.
|
protected java.lang.ClassLoader |
getClassLoaderFromJar(java.io.File classjar)
Helper method invoked by isRebuildRequired to get a ClassLoader for a
Jar File passed to it.
|
protected DescriptorHandler |
getDescriptorHandler(java.io.File srcDir)
Get a descriptionHandler.
|
protected java.lang.String |
getOptions()
Gets the options for the EJB Deploy operation
|
protected DescriptorHandler |
getWebsphereDescriptorHandler(java.io.File srcDir)
Get a description handler.
|
protected boolean |
isRebuildRequired(java.io.File genericJarFile,
java.io.File websphereJarFile)
Helper method to check to see if a websphere EBJ1.1 jar needs to be
rebuilt using ejbdeploy.
|
void |
setCodegen(boolean codegen)
Flag, default false, to only generate the deployment
code, do not run RMIC or Javac
|
void |
setDbname(java.lang.String dbName)
Sets the name of the Database to create; optional.
|
void |
setDbschema(java.lang.String dbSchema)
Sets the name of the schema to create; optional.
|
void |
setDbvendor(java.lang.String dbvendor)
Sets the DB Vendor for the Entity Bean mapping; optional.
|
void |
setEjbdeploy(boolean ejbdeploy)
Decide, whether ejbdeploy should be called or not;
optional, default true.
|
void |
setEJBdtd(java.lang.String inString)
Setter used to store the location of the Sun's Generic EJB DTD.
|
void |
setKeepgeneric(boolean inValue)
This controls whether the generic file used as input to
ejbdeploy is retained; optional, default false.
|
void |
setNewCMP(boolean newCMP)
Set the value of the newCMP scheme.
|
void |
setNoinform(boolean noinform)
Flag to disable informational messages; optional, default false.
|
void |
setNovalidate(boolean novalidate)
Flag to disable the validation steps; optional, default false.
|
void |
setNowarn(boolean nowarn)
Flag to disable warning and informational messages; optional, default false.
|
void |
setOldCMP(boolean oldCMP)
Set the value of the oldCMP scheme.
|
void |
setQuiet(boolean quiet)
Flag, default true, to only output error messages.
|
void |
setRebuild(boolean rebuild)
Set the rebuild flag to false to only update changes in the jar rather
than rerunning ejbdeploy; optional, default true.
|
void |
setRmicoptions(java.lang.String options)
Set the rmic options.
|
void |
setSuffix(java.lang.String inString)
String value appended to the basename of the deployment
descriptor to create the filename of the WebLogic EJB
jar file.
|
void |
setTempdir(java.lang.String tempdir)
The directory, where ejbdeploy will write temporary files;
optional, defaults to '_ejbdeploy_temp'.
|
void |
setTrace(boolean trace)
Flag to enable internal tracing when set, optional, default false.
|
void |
setUse35(boolean attr)
Flag to use the WebSphere 3.5 compatible mapping rules; optional, default false.
|
void |
setWASClasspath(Path wasClasspath)
Set the websphere classpath.
|
void |
validateConfigured()
Called to validate that the tool parameters have been configured.
|
protected void |
writeJar(java.lang.String baseName,
java.io.File jarFile,
java.util.Hashtable files,
java.lang.String publicId)
Method used to encapsulate the writing of the JAR file.
|
addFileToJar, addSupportClasses, checkAndAddDependants, checkConfiguration, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDestDir, getJarBaseName, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, processDescriptor, registerKnownDTDs, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName
public static final java.lang.String PUBLICID_EJB11
public static final java.lang.String PUBLICID_EJB20
protected static final java.lang.String SCHEMA_DIR
protected static final java.lang.String WAS_EXT
protected static final java.lang.String WAS_BND
protected static final java.lang.String WAS_CMP_MAP
protected static final java.lang.String WAS_CMP_SCHEMA
public Path createWASClasspath()
public void setWASClasspath(Path wasClasspath)
wasClasspath
- the websphere classpath.public void setDbvendor(java.lang.String dbvendor)
Valid options can be obtained by running the following command:
<WAS_HOME>/bin/EJBDeploy.[sh/bat] -help
This is also used to determine the name of the Map.mapxmi and Schema.dbxmi files, for example Account-DB2UDB_V81-Map.mapxmi and Account-DB2UDB_V81-Schema.dbxmi.
dbvendor
- database vendor typepublic void setDbname(java.lang.String dbName)
dbName
- name of the databasepublic void setDbschema(java.lang.String dbSchema)
dbSchema
- name of the schemapublic void setCodegen(boolean codegen)
codegen
- optionpublic void setQuiet(boolean quiet)
quiet
- optionpublic void setNovalidate(boolean novalidate)
novalidate
- optionpublic void setNowarn(boolean nowarn)
nowarn
- optionpublic void setNoinform(boolean noinform)
noinform
- if true disables informational messagespublic void setTrace(boolean trace)
trace
- a boolean
value.public void setRmicoptions(java.lang.String options)
options
- the options to use.public void setUse35(boolean attr)
attr
- a boolean
value.public void setRebuild(boolean rebuild)
rebuild
- a boolean
value.public void setSuffix(java.lang.String inString)
inString
- the string to use as the suffix.public void setKeepgeneric(boolean inValue)
inValue
- either 'true' or 'false'.public void setEjbdeploy(boolean ejbdeploy)
ejbdeploy
- a boolean
value.public void setEJBdtd(java.lang.String inString)
inString
- the string to use as the DTD location.public void setOldCMP(boolean oldCMP)
oldCMP
- a boolean
value.public void setNewCMP(boolean newCMP)
newCMP
- a boolean
value.public void setTempdir(java.lang.String tempdir)
tempdir
- the directory name to use.protected DescriptorHandler getDescriptorHandler(java.io.File srcDir)
getDescriptorHandler
in class GenericDeploymentTool
srcDir
- the source directory.protected DescriptorHandler getWebsphereDescriptorHandler(java.io.File srcDir)
srcDir
- the source directory.protected void addVendorFiles(java.util.Hashtable ejbFiles, java.lang.String baseName)
addVendorFiles
in class GenericDeploymentTool
ejbFiles
- a hashtable entryname -> file.baseName
- a prefix to use.protected java.lang.String getOptions()
protected void writeJar(java.lang.String baseName, java.io.File jarFile, java.util.Hashtable files, java.lang.String publicId) throws BuildException
writeJar
in class GenericDeploymentTool
baseName
- the base name to use.jarFile
- the jar file to write to.files
- the files to write to the jar.publicId
- the id to use.BuildException
- if there is a problem.public void validateConfigured() throws BuildException
validateConfigured
in interface EJBDeploymentTool
validateConfigured
in class GenericDeploymentTool
BuildException
- if there is an error.protected boolean isRebuildRequired(java.io.File genericJarFile, java.io.File websphereJarFile)
The way websphere ejbdeploy works is it creates wrappers for the publicly defined methods as they are exposed in the remote interface. If the actual bean changes without changing the the method signatures then only the bean classfile needs to be updated and the rest of the websphere jar file can remain the same. If the Interfaces, ie. the method signatures change or if the xml deployment descriptors changed, the whole jar needs to be rebuilt with ejbdeploy. This is not strictly true for the xml files. If the JNDI name changes then the jar doesn't have to be rebuild, but if the resources references change then it does. At this point the websphere jar gets rebuilt if the xml files change at all.
genericJarFile
- java.io.File The generic jar file.websphereJarFile
- java.io.File The websphere jar file to check to
see if it needs to be rebuilt.protected java.lang.ClassLoader getClassLoaderFromJar(java.io.File classjar) throws java.io.IOException
classjar
- java.io.File representing jar file to get classes from.java.io.IOException
- if there is an error.