public class WeblogicDeploymentTool extends GenericDeploymentTool
Modifier and Type | Field and Description |
---|---|
protected static String |
COMPILER_EJB11 |
protected static String |
COMPILER_EJB20 |
protected static String |
DEFAULT_COMPILER |
protected static String |
DEFAULT_WL51_DTD_LOCATION |
protected static String |
DEFAULT_WL51_EJB11_DTD_LOCATION
Weblogic 5.1 dtd location
|
protected static String |
DEFAULT_WL60_51_DTD_LOCATION |
protected static String |
DEFAULT_WL60_DTD_LOCATION |
protected static String |
DEFAULT_WL60_EJB11_DTD_LOCATION
Weblogic 6.0 ejb 1.1 dtd location
|
protected static String |
DEFAULT_WL60_EJB20_DTD_LOCATION
Weblogic 6.0 ejb 2.0 dtd location
|
protected static String |
DEFAULT_WL70_DTD_LOCATION |
static String |
PUBLICID_EJB11
EJB11 id
|
static String |
PUBLICID_EJB20
EJB20 id
|
static String |
PUBLICID_WEBLOGIC_EJB510
Weblogic 5.1.0 id
|
static String |
PUBLICID_WEBLOGIC_EJB600
Weblogic 6.0.0 id
|
static String |
PUBLICID_WEBLOGIC_EJB700
Weblogic 7.0.0 id
|
protected static String |
WL_CMP_DD |
protected static String |
WL_DD |
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 |
---|
WeblogicDeploymentTool() |
Modifier and Type | Method and Description |
---|---|
void |
addSysproperty(Environment.Variable sysp)
Add a nested sysproperty element.
|
protected void |
addVendorFiles(Hashtable ejbFiles,
String ddPrefix)
Add any vendor specific files which should be included in the EJB Jar.
|
Path |
createWLClasspath()
Get the classpath to the weblogic classpaths.
|
protected java.lang.ClassLoader |
getClassLoaderFromJar(File classjar)
Helper method invoked by isRebuildRequired to get a ClassLoader for a
Jar File passed to it.
|
String |
getEjbcClass()
Get the ejbc compiler class.
|
Integer |
getJvmDebugLevel()
Get the debug level.
|
protected DescriptorHandler |
getWeblogicDescriptorHandler(File srcDir)
Get the weblogic descriptor handler.
|
protected boolean |
isRebuildRequired(File genericJarFile,
File weblogicJarFile)
Helper method to check to see if a weblogic EBJ1.1 jar needs to be
rebuilt using ejbc.
|
protected void |
registerKnownDTDs(DescriptorHandler handler)
Register the DTDs.
|
void |
setArgs(String args)
Any optional extra arguments pass to the weblogic.ejbc
tool.
|
void |
setCompiler(String compiler)
The compiler (switch
-compiler ) to use; optional. |
void |
setEjbcClass(String ejbcClass)
Set the classname of the ejbc compiler; optional
Normally ejbjar determines
the appropriate class based on the DTD used for the EJB.
|
void |
setEJBdtd(String inString)
Deprecated.
|
void |
setJvmargs(String args)
Set any additional arguments to pass to the weblogic JVM; optional.
|
void |
setJvmDebugLevel(Integer jvmDebugLevel)
Sets the weblogic.StdoutSeverityLevel to use when running the JVM that
executes ejbc; optional.
|
void |
setKeepgenerated(String inValue)
Controls whether weblogic will keep the generated Java
files used to build the class files added to the
jar.
|
void |
setKeepgeneric(boolean inValue)
controls whether the generic file used as input to
ejbc is retained; defaults to false
|
void |
setNewCMP(boolean newCMP)
If this is set to true, the new method for locating
CMP descriptors will be used; optional, default false.
|
void |
setNoEJBC(boolean noEJBC)
Do not EJBC the jar after it has been put together;
optional, default false
|
void |
setOldCMP(boolean oldCMP)
Set the value of the oldCMP scheme.
|
void |
setOutputDir(File outputDir)
If set ejbc will use this directory as the output
destination rather than a jar file.
|
void |
setRebuild(boolean rebuild)
Set the rebuild flag to false to only update changes in the jar rather
than rerunning ejbc; optional, default true.
|
void |
setSuffix(String inString)
Setter used to store the suffix for the generated weblogic jar file.
|
void |
setWeblogicdtd(String inString)
Deprecated.
|
void |
setWLClasspath(Path wlClasspath)
Optional classpath to WL6.0.
|
void |
setWLdtd(String inString)
Deprecated.
|
void |
validateConfigured()
Called to validate that the tool parameters have been configured.
|
protected void |
writeJar(String baseName,
File jarFile,
Hashtable files,
String publicId)
Method used to encapsulate the writing of the JAR file.
|
addFileToJar, addSupportClasses, checkAndAddDependants, checkConfiguration, configure, createClasspath, getClassLoaderForBuild, getCombinedClasspath, getConfig, getDescriptorHandler, getDestDir, getJarBaseName, getLocation, getManifestFile, getPublicId, getTask, getVendorDDPrefix, log, needToRebuild, parseEjbFiles, processDescriptor, setClasspath, setDestdir, setGenericJarSuffix, setTask, usingBaseJarName
protected static final String COMPILER_EJB11
protected static final String COMPILER_EJB20
protected static final String DEFAULT_COMPILER
protected static final String DEFAULT_WL51_DTD_LOCATION
protected static final String DEFAULT_WL51_EJB11_DTD_LOCATION
protected static final String DEFAULT_WL60_51_DTD_LOCATION
protected static final String DEFAULT_WL60_DTD_LOCATION
protected static final String DEFAULT_WL60_EJB11_DTD_LOCATION
protected static final String DEFAULT_WL60_EJB20_DTD_LOCATION
protected static final String DEFAULT_WL70_DTD_LOCATION
public static final String PUBLICID_EJB11
public static final String PUBLICID_EJB20
public static final String PUBLICID_WEBLOGIC_EJB510
public static final String PUBLICID_WEBLOGIC_EJB600
public static final String PUBLICID_WEBLOGIC_EJB700
protected static final String WL_CMP_DD
protected static final String WL_DD
public void addSysproperty(Environment.Variable sysp)
sysp
- the element to add.protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix)
addVendorFiles
in class GenericDeploymentTool
ejbFiles
- the hash table to be populated.ddPrefix
- the prefix to use.public Path createWLClasspath()
protected java.lang.ClassLoader getClassLoaderFromJar(File classjar) throws IOException
classjar
- java.io.File representing jar file to get classes from.IOException
- if there is a problem.public String getEjbcClass()
public Integer getJvmDebugLevel()
protected DescriptorHandler getWeblogicDescriptorHandler(File srcDir)
srcDir
- the source directory.protected boolean isRebuildRequired(File genericJarFile, File weblogicJarFile)
The way weblogic ejbc 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 weblogic 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 ejbc. 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 weblogic jar gets rebuilt if the xml files change at all.
genericJarFile
- java.io.File The generic jar file.weblogicJarFile
- java.io.File The weblogic jar file to check to
see if it needs to be rebuilt.protected void registerKnownDTDs(DescriptorHandler handler)
registerKnownDTDs
in class GenericDeploymentTool
handler
- the handler to use.public void setArgs(String args)
args
- extra arguments to pass to the ejbc tool.public void setCompiler(String compiler)
-compiler
) to use; optional.
This allows for the selection of a different compiler
to be used for the compilation of the generated Java
files. This could be set, for example, to Jikes to
compile with the Jikes compiler. If this is not set
and the build.compiler
property is set
to jikes, the Jikes compiler will be used. If this
is not desired, the value "default
"
may be given to use the default compiler.compiler
- the compiler to be used.public void setEjbcClass(String ejbcClass)
ejbcClass
- the name of the class to use.public void setEJBdtd(String inString)
inString
- the string to use as the DTD location.public void setJvmargs(String args)
args
- the arguments to be passed to the JVMpublic void setJvmDebugLevel(Integer jvmDebugLevel)
jvmDebugLevel
- the value to use.public void setKeepgenerated(String inValue)
inValue
- either 'true' or 'false'public void setKeepgeneric(boolean inValue)
inValue
- true for keep genericpublic void setNewCMP(boolean newCMP)
The old CMP scheme locates the weblogic CMP descriptor based on the naming convention where the weblogic 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 weblogic EJB descriptor. Also, descriptors which contain multiple CMP references could not be used.
newCMP
- a boolean
value.public void setNoEJBC(boolean noEJBC)
noEJBC
- a boolean
value.public void setOldCMP(boolean oldCMP)
oldCMP
- a boolean
value.public void setOutputDir(File outputDir)
outputDir
- the directory to be used.public void setRebuild(boolean rebuild)
rebuild
- a boolean
value.public void setSuffix(String inString)
inString
- the string to use as the suffix.public void setWeblogicdtd(String inString)
inString
- the string to use as the DTD location.public void setWLClasspath(Path wlClasspath)
wlClasspath
- the path to be used.public void setWLdtd(String inString)
inString
- the string to use as the DTD location.public void validateConfigured() throws BuildException
validateConfigured
in interface EJBDeploymentTool
validateConfigured
in class GenericDeploymentTool
BuildException
- if there is an error.protected void writeJar(String baseName, File jarFile, Hashtable files, String publicId) throws BuildException
writeJar
in class GenericDeploymentTool
baseName
- the base name.jarFile
- the jar file to populate.files
- the hash table of files to write.publicId
- the id to use.BuildException
- if there is a problem.