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 |
---|---|
private boolean | |
private boolean | codegen
true - Only generate the deployment code, do not run RMIC or Javac |
private String | dbName
The name of the database to create. |
private String | dbSchema
The name of the schema to create. |
private String | dbVendor
The DB Vendor name, the EJB is persisted against |
private String | ejb11DTD
Instance variable that stores the location of the ejb 1.1 DTD file. |
private boolean | |
private static final FileUtils | |
private String | jarSuffix
Instance variable that stores the suffix for the WebSphere jarfile. |
private boolean | keepGeneric
Instance variable that determines whether generic ejb jars are kept. |
private boolean | newCMP
Indicates if the old CMP location convention is to be used. |
private boolean | noinform
true - Disable informational messages |
private boolean | novalidate
true - Disable the validation steps |
private boolean | nowarn
true - Disable warning and informational messages |
public static final String | PUBLICID_EJB11
ID for ejb 1.1 |
public static final String | PUBLICID_EJB20
ID for ejb 2.0 |
private boolean | quiet
true - Only output error messages, suppress informational messages |
private String | rmicOptions
Additional options for RMIC |
protected static final String | SCHEMA_DIR
Schema directory |
private String | tempdir
the scratchdir for the ejbdeploy operation |
private boolean | trace
true - Enable internal tracing |
private boolean | use35MappingRules
true- Use the WebSphere 3.5 compatible mapping rules |
protected static final String | |
protected static final String | |
protected static final String | |
protected static final String | |
private Path | wasClasspath
The classpath to the WebSphere classes. |
private File | websphereHome
the home directory for WebSphere |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
protected void | addVendorFiles(Hashtable<String, File>
a hashtable entryname -> file. ejbFiles, String a prefix to use. baseName)Overrides org. |
private void | buildWebsphereJar(File
java.io.File representing the source (EJB1.1) jarfile. sourceJar, File java.io.File representing the destination, WebSphere
jarfile. destJar)Helper method invoked by execute() for each WebSphere jar to be built. |
public Path | |
protected ClassLoader | Returns: a classloader for the jar file.java.io.File representing jar file to get classes from. classjar)Helper method invoked by isRebuildRequired to get a ClassLoader for a Jar File passed to it. |
protected DescriptorHandler | getDescriptorHandler(File
the source directory. srcDir)Overrides org.
Deprecated
as a consequence of
Get a descriptionHandler..
DescriptorHandler being deprecated.
|
protected String | |
pack-priv File | getVendorOutputJarFile(String
the basename to use. baseName)Overrides org. |
protected DescriptorHandler | Returns: the handler.the source directory. srcDir)
Deprecated
as a consequence of
Get a description handler.
DescriptorHandler being deprecated.
|
protected boolean | Returns: true if a rebuild is required.java.io.File The generic jar file. genericJarFile, File java.io.File The WebSphere jar file to check to
see if it needs to be rebuilt. websphereJarFile)Helper method to check to see if a WebSphere EJB 1.1 jar needs to be rebuilt using ejbdeploy. |
public void | setCodegen(boolean
option codegen)Flag, default false, to only generate the deployment code, do not run RMIC or Javac |
public void | |
public void | |
public void | setDbvendor(String
database vendor type dbvendor)Sets the DB Vendor for the Entity Bean mapping; optional. |
public void | setEjbdeploy(boolean
a ejbdeploy)boolean value.Decide, whether ejbdeploy should be called or not; optional, default true. |
public void | |
public void | setKeepgeneric(boolean
either 'true' or 'false'. inValue)This controls whether the generic file used as input to ejbdeploy is retained; optional, default false. |
public void | |
public void | setNoinform(boolean
if true disables informational messages noinform)Flag to disable informational messages; optional, default false. |
public void | setNovalidate(boolean
option novalidate)Flag to disable the validation steps; optional, default false. |
public void | setNowarn(boolean
option nowarn)Flag to disable warning and informational messages; optional, default false. |
public void | |
public void | |
public void | setRebuild(boolean
a rebuild)boolean value.Set the rebuild flag to false to only update changes in the jar rather than rerunning ejbdeploy; optional, default true. |
public void | |
public void | |
public void | setTempdir(String
the directory name to use. tempdir)The directory, where ejbdeploy will write temporary files; optional, defaults to '_ejbdeploy_temp'. |
public void | setTrace(boolean
a trace)boolean value.Flag to enable internal tracing when set, optional, default false. |
public void | setUse35(boolean
a attr)boolean value.Flag to use the WebSphere 3.5 compatible mapping rules; optional, default false. |
public void | |
public void | validateConfigured()
Overrides org. Implements org. |
protected void | writeJar(String
the base name to use. baseName, File the jar file to write to. jarFile, Hashtable<String, File> the files to write to the jar. files, String the id to use. publicId)Overrides org. |
alwaysRebuild | back to summary |
---|---|
private boolean alwaysRebuild |
codegen | back to summary |
---|---|
private boolean codegen true - Only generate the deployment code, do not run RMIC or Javac |
dbName | back to summary |
---|---|
private String dbName The name of the database to create. (For top-down mapping only) |
dbSchema | back to summary |
---|---|
private String dbSchema The name of the schema to create. (For top-down mappings only) |
dbVendor | back to summary |
---|---|
private String dbVendor The DB Vendor name, the EJB is persisted against |
ejb11DTD | back to summary |
---|---|
private String ejb11DTD Instance variable that stores the location of the ejb 1.1 DTD file. |
ejbdeploy | back to summary |
---|---|
private boolean ejbdeploy |
FILE_UTILS | back to summary |
---|---|
private static final FileUtils FILE_UTILS |
jarSuffix | back to summary |
---|---|
private String jarSuffix Instance variable that stores the suffix for the WebSphere jarfile. |
keepGeneric | back to summary |
---|---|
private boolean keepGeneric Instance variable that determines whether generic ejb jars are kept. |
newCMP | back to summary |
---|---|
private boolean newCMP Indicates if the old CMP location convention is to be used. |
noinform | back to summary |
---|---|
private boolean noinform true - Disable informational messages |
novalidate | back to summary |
---|---|
private boolean novalidate true - Disable the validation steps |
nowarn | back to summary |
---|---|
private boolean nowarn true - Disable warning and informational messages |
PUBLICID_EJB11 | back to summary |
---|---|
public static final String PUBLICID_EJB11 ID for ejb 1.1 |
PUBLICID_EJB20 | back to summary |
---|---|
public static final String PUBLICID_EJB20 ID for ejb 2.0 |
quiet | back to summary |
---|---|
private boolean quiet true - Only output error messages, suppress informational messages |
rmicOptions | back to summary |
---|---|
private String rmicOptions Additional options for RMIC |
SCHEMA_DIR | back to summary |
---|---|
protected static final String SCHEMA_DIR Schema directory |
tempdir | back to summary |
---|---|
private String tempdir the scratchdir for the ejbdeploy operation |
trace | back to summary |
---|---|
private boolean trace true - Enable internal tracing |
use35MappingRules | back to summary |
---|---|
private boolean use35MappingRules true- Use the WebSphere 3.5 compatible mapping rules |
WAS_BND | back to summary |
---|---|
protected static final String WAS_BND |
WAS_CMP_MAP | back to summary |
---|---|
protected static final String WAS_CMP_MAP |
WAS_CMP_SCHEMA | back to summary |
---|---|
protected static final String WAS_CMP_SCHEMA |
WAS_EXT | back to summary |
---|---|
protected static final String WAS_EXT |
wasClasspath | back to summary |
---|---|
private Path wasClasspath The classpath to the WebSphere classes. |
websphereHome | back to summary |
---|---|
private File websphereHome the home directory for WebSphere |
WebsphereDeploymentTool | back to summary |
---|---|
public WebsphereDeploymentTool() |
addVendorFiles | back to summary |
---|---|
protected void addVendorFiles(Hashtable<String, File> ejbFiles, String baseName) Overrides org. Add any vendor specific files which should be included in the EJB Jar. |
buildWebsphereJar | back to summary |
---|---|
private void buildWebsphereJar(File sourceJar, File destJar) Helper method invoked by execute() for each WebSphere jar to be built. Encapsulates the logic of constructing a java task for calling websphere.ejbdeploy and executing it. |
createWASClasspath | back to summary |
---|---|
public Path createWASClasspath() Get the classpath to the WebSphere classpaths.
|
getClassLoaderFromJar | back to summary |
---|---|
protected ClassLoader getClassLoaderFromJar(File classjar) throws IOException Helper method invoked by isRebuildRequired to get a ClassLoader for a Jar File passed to it.
|
getDescriptorHandler | back to summary |
---|---|
protected DescriptorHandler getDescriptorHandler(File srcDir) Overrides org. Doc from org. Deprecated as a consequence of Get a descriptionHandler..
|
getOptions | back to summary |
---|---|
protected String getOptions() Gets the options for the EJB Deploy operation
|
getVendorOutputJarFile | back to summary |
---|---|
pack-priv File getVendorOutputJarFile(String baseName) Overrides org. Get the vendor specific name of the Jar that will be output. The modification date of this jar will be checked against the dependent bean classes.
|
getWebsphereDescriptorHandler | back to summary |
---|---|
protected DescriptorHandler getWebsphereDescriptorHandler(final File srcDir)
Deprecated as a consequence of Get a description handler.
|
isRebuildRequired | back to summary |
---|---|
protected boolean isRebuildRequired(File genericJarFile, File websphereJarFile) Helper method to check to see if a WebSphere EJB 1.1 jar needs to be rebuilt using ejbdeploy. Called from writeJar it sees if the "Bean" classes are the only thing that needs to be updated and either updates the Jar with the Bean classfile or returns true, saying that the whole WebSphere jar needs to be regenerated with ejbdeploy. This allows faster build times for working developers. 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. |
setCodegen | back to summary |
---|---|
public void setCodegen(boolean codegen) Flag, default false, to only generate the deployment code, do not run RMIC or Javac
|
setDbname | back to summary |
---|---|
public void setDbname(String dbName) Sets the name of the Database to create; optional.
|
setDbschema | back to summary |
---|---|
public void setDbschema(String dbSchema) Sets the name of the schema to create; optional.
|
setDbvendor | back to summary |
---|---|
public void setDbvendor(String dbvendor) Sets the DB Vendor for the Entity Bean mapping; optional.
Valid options can be obtained by running the following command:
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.
|
setEjbdeploy | back to summary |
---|---|
public void setEjbdeploy(boolean ejbdeploy) Decide, whether ejbdeploy should be called or not; optional, default true.
|
setEJBdtd | back to summary |
---|---|
public void setEJBdtd(String inString) Setter used to store the location of the Sun's Generic EJB DTD. This can be a file on the system or a resource on the classpath.
|
setKeepgeneric | back to summary |
---|---|
public void setKeepgeneric(boolean inValue) This controls whether the generic file used as input to ejbdeploy is retained; optional, default false.
|
setNewCMP | back to summary |
---|---|
public void setNewCMP(boolean newCMP) Set the value of the newCMP scheme. The old CMP scheme locates the WebSphere CMP descriptor based on the naming convention where the WebSphere CMP file is expected to be named with the bean name as the prefix. Under this scheme the name of the CMP descriptor does not match the name actually used in the main WebSphere EJB descriptor. Also, descriptors which contain multiple CMP references could not be used.
|
setNoinform | back to summary |
---|---|
public void setNoinform(boolean noinform) Flag to disable informational messages; optional, default false.
|
setNovalidate | back to summary |
---|---|
public void setNovalidate(boolean novalidate) Flag to disable the validation steps; optional, default false.
|
setNowarn | back to summary |
---|---|
public void setNowarn(boolean nowarn) Flag to disable warning and informational messages; optional, default false.
|
setOldCMP | back to summary |
---|---|
public void setOldCMP(boolean oldCMP) Set the value of the oldCMP scheme. This is an antonym for newCMP
|
setQuiet | back to summary |
---|---|
public void setQuiet(boolean quiet) Flag, default true, to only output error messages.
|
setRebuild | back to summary |
---|---|
public void setRebuild(boolean rebuild) Set the rebuild flag to false to only update changes in the jar rather than rerunning ejbdeploy; optional, default true.
|
setRmicoptions | back to summary |
---|---|
public void setRmicoptions(String options) Set the rmic options.
|
setSuffix | back to summary |
---|---|
public void setSuffix(String inString) String value appended to the basename of the deployment descriptor to create the filename of the WebLogic EJB jar file. Optional, default '.jar'.
|
setTempdir | back to summary |
---|---|
public void setTempdir(String tempdir) The directory, where ejbdeploy will write temporary files; optional, defaults to '_ejbdeploy_temp'.
|
setTrace | back to summary |
---|---|
public void setTrace(boolean trace) Flag to enable internal tracing when set, optional, default false.
|
setUse35 | back to summary |
---|---|
public void setUse35(boolean attr) Flag to use the WebSphere 3.5 compatible mapping rules; optional, default false.
|
setWASClasspath | back to summary |
---|---|
public void setWASClasspath(Path wasClasspath) Set the WebSphere classpath.
|
validateConfigured | back to summary |
---|---|
public void validateConfigured() throws BuildException Overrides org. Implements org. Called to validate that the tool parameters have been configured.
|
writeJar | back to summary |
---|---|
protected void writeJar(String baseName, File jarFile, Hashtable<String, File> files, String publicId) throws BuildException Overrides org. Doc from org. Method 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.. |