Browse Source

D'Oh - didn;t resolve all conflicts :-( - done now.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269767 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
651b15a3e5
2 changed files with 100 additions and 77 deletions
  1. +1
    -5
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
  2. +99
    -72
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java

+ 1
- 5
src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java View File

@@ -342,12 +342,8 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase {




protected void processElement() { protected void processElement() {
<<<<<<< DescriptorHandler.java
if (parseState != STATE_IN_ENTITY && parseState != STATE_IN_SESSION && parseState != STATE_IN_MESSAGE) {
=======
if (inEJBRef || if (inEJBRef ||
(parseState != STATE_IN_ENTITY && parseState != STATE_IN_SESSION)) {
>>>>>>> 1.12
(parseState != STATE_IN_ENTITY && parseState != STATE_IN_SESSION && parseState != STATE_IN_MESSAGE)) {
return; return;
} }




+ 99
- 72
src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java View File

@@ -76,28 +76,28 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public static final String PUBLICID_WEBLOGIC_EJB600 public static final String PUBLICID_WEBLOGIC_EJB600
= "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN"; = "-//BEA Systems, Inc.//DTD WebLogic 6.0.0 EJB//EN";


protected static final String DEFAULT_WL51_EJB11_DTD_LOCATION
protected static final String DEFAULT_WL51_EJB11_DTD_LOCATION
= "/weblogic/ejb/deployment/xml/ejb-jar.dtd"; = "/weblogic/ejb/deployment/xml/ejb-jar.dtd";
protected static final String DEFAULT_WL60_EJB11_DTD_LOCATION
protected static final String DEFAULT_WL60_EJB11_DTD_LOCATION
= "/weblogic/ejb20/dd/xml/ejb11-jar.dtd"; = "/weblogic/ejb20/dd/xml/ejb11-jar.dtd";
protected static final String DEFAULT_WL60_EJB20_DTD_LOCATION
protected static final String DEFAULT_WL60_EJB20_DTD_LOCATION
= "/weblogic/ejb20/dd/xml/ejb20-jar.dtd"; = "/weblogic/ejb20/dd/xml/ejb20-jar.dtd";


protected static final String DEFAULT_WL51_DTD_LOCATION
protected static final String DEFAULT_WL51_DTD_LOCATION
= "/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd"; = "/weblogic/ejb/deployment/xml/weblogic-ejb-jar.dtd";
protected static final String DEFAULT_WL60_51_DTD_LOCATION
protected static final String DEFAULT_WL60_51_DTD_LOCATION
= "/weblogic/ejb20/dd/xml/weblogic510-ejb-jar.dtd"; = "/weblogic/ejb20/dd/xml/weblogic510-ejb-jar.dtd";
protected static final String DEFAULT_WL60_DTD_LOCATION
protected static final String DEFAULT_WL60_DTD_LOCATION
= "/weblogic/ejb20/dd/xml/weblogic600-ejb-jar.dtd"; = "/weblogic/ejb20/dd/xml/weblogic600-ejb-jar.dtd";


protected static final String DEFAULT_COMPILER = "default";
protected static final String DEFAULT_COMPILER = "default";
protected static final String WL_DD = "weblogic-ejb-jar.xml"; protected static final String WL_DD = "weblogic-ejb-jar.xml";
protected static final String WL_CMP_DD = "weblogic-cmp-rdbms-jar.xml"; protected static final String WL_CMP_DD = "weblogic-cmp-rdbms-jar.xml";


protected static final String COMPILER_EJB11 = "weblogic.ejbc"; protected static final String COMPILER_EJB11 = "weblogic.ejbc";
protected static final String COMPILER_EJB20 = "weblogic.ejbc20"; protected static final String COMPILER_EJB20 = "weblogic.ejbc20";
/** Instance variable that stores the suffix for the weblogic jarfile. */ /** Instance variable that stores the suffix for the weblogic jarfile. */
private String jarSuffix = ".jar"; private String jarSuffix = ".jar";


@@ -106,7 +106,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {


/** Instance variable that stores the location of the ejb 1.1 DTD file. */ /** Instance variable that stores the location of the ejb 1.1 DTD file. */
private String ejb11DTD; private String ejb11DTD;
/** Instance variable that determines whether generic ejb jars are kept. */ /** Instance variable that determines whether generic ejb jars are kept. */
private boolean keepgenerated = false; private boolean keepgenerated = false;


@@ -123,7 +123,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {


/** controls whether ejbc is run on the generated jar */ /** controls whether ejbc is run on the generated jar */
private boolean noEJBC = false; private boolean noEJBC = false;
/** /**
* Indicates if the old CMP location convention is to be used. * Indicates if the old CMP location convention is to be used.
*/ */
@@ -132,6 +132,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
/** The classpath to the weblogic classes. */ /** The classpath to the weblogic classes. */
private Path wlClasspath = null; private Path wlClasspath = null;


/**
* The weblogic.StdoutSeverityLevel to use when running the JVM that executes ejbc.
* Set to 16 to avoid the warnings about EJB Home and Remotes being in the classpath
*/
private Integer jvmDebugLevel = null;

/** /**
* Get the classpath to the weblogic classpaths * Get the classpath to the weblogic classpaths
*/ */
@@ -141,7 +147,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }
return wlClasspath.createPath(); return wlClasspath.createPath();
} }
public void setWLClasspath(Path wlClasspath) { public void setWLClasspath(Path wlClasspath) {
this.wlClasspath = wlClasspath; this.wlClasspath = wlClasspath;
} }
@@ -152,7 +158,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public void setCompiler(String compiler) { public void setCompiler(String compiler) {
this.compiler = compiler; this.compiler = compiler;
} }
/** /**
* Set the rebuild flag to false to only update changes in the * Set the rebuild flag to false to only update changes in the
* jar rather than rerunning ejbc * jar rather than rerunning ejbc
@@ -160,7 +166,22 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public void setRebuild(boolean rebuild) { public void setRebuild(boolean rebuild) {
this.alwaysRebuild = rebuild; this.alwaysRebuild = rebuild;
} }

/**
* Sets the weblogic.StdoutSeverityLevel to use when running the JVM that executes ejbc.
* Set to 16 to avoid the warnings about EJB Home and Remotes being in the classpath
*/
public void setJvmDebugLevel(Integer jvmDebugLevel)
{
this.jvmDebugLevel = jvmDebugLevel;
}

public Integer getJvmDebugLevel()
{
return jvmDebugLevel;
}




/** /**
* Setter used to store the suffix for the generated weblogic jar file. * Setter used to store the suffix for the generated weblogic jar file.
@@ -193,7 +214,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public void setArgs(String args) { public void setArgs(String args) {
this.additionalArgs = args; this.additionalArgs = args;
} }
/** /**
* Set the classname of the ejbc compiler * Set the classname of the ejbc compiler
*/ */
@@ -201,7 +222,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
{ {
this.ejbcClass = ejbcClass; this.ejbcClass = ejbcClass;
} }
/** /**
* Get the ejbc compiler class * Get the ejbc compiler class
*/ */
@@ -209,11 +230,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
{ {
return ejbcClass; return ejbcClass;
} }
/** /**
* Setter used to store the location of the ejb-jar DTD. This can be a file on the system
* or a resource on the classpath.
* Setter used to store the location of the ejb-jar DTD. This can be a file on the system
* or a resource on the classpath.
* @param inString the string to use as the DTD location. * @param inString the string to use as the DTD location.
*/ */
public void setWeblogicdtd(String inString) { public void setWeblogicdtd(String inString) {
@@ -221,8 +242,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }


/** /**
* Setter used to store the location of the weblogic DTD. This can be a file on the system
* or a resource on the classpath.
* Setter used to store the location of the weblogic DTD. This can be a file on the system
* or a resource on the classpath.
* @param inString the string to use as the DTD location. * @param inString the string to use as the DTD location.
*/ */
public void setWLdtd(String inString) { public void setWLdtd(String inString) {
@@ -230,8 +251,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }


/** /**
* 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.
* 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.
* @param inString the string to use as the DTD location. * @param inString the string to use as the DTD location.
*/ */
public void setEJBdtd(String inString) { public void setEJBdtd(String inString) {
@@ -245,14 +266,14 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public void setOldCMP(boolean oldCMP) { public void setOldCMP(boolean oldCMP) {
this.newCMP = !oldCMP; this.newCMP = !oldCMP;
} }
/** /**
* Set the value of the newCMP scheme. The old CMP scheme locates the
* weblogic CMP descriptor based on the naming convention where the
* Set the value of the newCMP scheme. 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. * 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 * 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
* actually used in the main weblogic EJB descriptor. Also, descriptors which
* contain multiple CMP references could not be used. * contain multiple CMP references could not be used.
* *
*/ */
@@ -267,7 +288,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
public void setNoEJBC(boolean noEJBC) { public void setNoEJBC(boolean noEJBC) {
this.noEJBC = noEJBC; this.noEJBC = noEJBC;
} }
protected void registerKnownDTDs(DescriptorHandler handler) { protected void registerKnownDTDs(DescriptorHandler handler) {
// register all the known DTDs // register all the known DTDs
handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL51_EJB11_DTD_LOCATION); handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL51_EJB11_DTD_LOCATION);
@@ -277,17 +298,17 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }


protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) { protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) {
DescriptorHandler handler =
new DescriptorHandler(getTask(), srcDir) {
DescriptorHandler handler =
new DescriptorHandler(getTask(), srcDir) {
protected void processElement() { protected void processElement() {
if (currentElement.equals("type-storage")) { if (currentElement.equals("type-storage")) {
// Get the filename of vendor specific descriptor // Get the filename of vendor specific descriptor
String fileNameWithMETA = currentText; String fileNameWithMETA = currentText;
//trim the META_INF\ off of the file name //trim the META_INF\ off of the file name
String fileName = fileNameWithMETA.substring(META_DIR.length(),
String fileName = fileNameWithMETA.substring(META_DIR.length(),
fileNameWithMETA.length() ); fileNameWithMETA.length() );
File descriptorFile = new File(srcDir, fileName); File descriptorFile = new File(srcDir, fileName);
ejbFiles.put(fileNameWithMETA, descriptorFile); ejbFiles.put(fileNameWithMETA, descriptorFile);
} }
} }
@@ -298,16 +319,16 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
handler.registerDTD(PUBLICID_WEBLOGIC_EJB600, DEFAULT_WL60_DTD_LOCATION); handler.registerDTD(PUBLICID_WEBLOGIC_EJB600, DEFAULT_WL60_DTD_LOCATION);
handler.registerDTD(PUBLICID_WEBLOGIC_EJB510, weblogicDTD); handler.registerDTD(PUBLICID_WEBLOGIC_EJB510, weblogicDTD);
handler.registerDTD(PUBLICID_WEBLOGIC_EJB600, weblogicDTD); handler.registerDTD(PUBLICID_WEBLOGIC_EJB600, weblogicDTD);
for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) { for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next(); EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation()); handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
} }
return handler;
return handler;
} }


/** /**
* Add any vendor specific files which should be included in the
* Add any vendor specific files which should be included in the
* EJB Jar. * EJB Jar.
*/ */
protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) {
@@ -318,7 +339,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
weblogicDD); weblogicDD);
} }
else { else {
log("Unable to locate weblogic deployment descriptor. It was expected to be in " +
log("Unable to locate weblogic deployment descriptor. It was expected to be in " +
weblogicDD.getPath(), Project.MSG_WARN); weblogicDD.getPath(), Project.MSG_WARN);
return; return;
} }
@@ -329,7 +350,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
"to use the new CMP descriptor inclusion mechanism. ", Project.MSG_VERBOSE); "to use the new CMP descriptor inclusion mechanism. ", Project.MSG_VERBOSE);
// The the weblogic cmp deployment descriptor // The the weblogic cmp deployment descriptor
File weblogicCMPDD = new File(getConfig().descriptorDir, ddPrefix + WL_CMP_DD); File weblogicCMPDD = new File(getConfig().descriptorDir, ddPrefix + WL_CMP_DD);
if (weblogicCMPDD.exists()) { if (weblogicCMPDD.exists()) {
ejbFiles.put(META_DIR + WL_CMP_DD, ejbFiles.put(META_DIR + WL_CMP_DD,
weblogicCMPDD); weblogicCMPDD);
@@ -351,7 +372,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
(new FileInputStream (new FileInputStream
(weblogicDD)), (weblogicDD)),
handler); handler);
Hashtable ht = handler.getFiles(); Hashtable ht = handler.getFiles();
Enumeration e = ht.keys(); Enumeration e = ht.keys();
while(e.hasMoreElements()){ while(e.hasMoreElements()){
@@ -360,13 +381,13 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }
} }
catch(Exception e) catch(Exception e)
{
{
String msg = "Exception while adding Vendor specific files: " + e.toString(); String msg = "Exception while adding Vendor specific files: " + e.toString();
throw new BuildException(msg, e); throw new BuildException(msg, e);
} }
} }
} }
/** /**
* Get the vendor specific name of the Jar that will be output. The modification date * 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. * of this jar will be checked against the dependent bean classes.
@@ -400,10 +421,16 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }


String ejbcClassName = ejbcClass; String ejbcClassName = ejbcClass;
try { try {
javaTask = (Java) getTask().getProject().createTask("java"); javaTask = (Java) getTask().getProject().createTask("java");
javaTask.setTaskName("ejbc"); javaTask.setTaskName("ejbc");

if (getJvmDebugLevel() != null)
{
javaTask.createJvmarg().setLine(" -Dweblogic.StdoutSeverityLevel=" + jvmDebugLevel);
}

if (ejbcClassName == null) { if (ejbcClassName == null) {
// try to determine it from publicId // try to determine it from publicId
if (PUBLICID_EJB11.equals(publicId)) { if (PUBLICID_EJB11.equals(publicId)) {
@@ -417,7 +444,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
ejbcClassName = COMPILER_EJB11; ejbcClassName = COMPILER_EJB11;
} }
} }
javaTask.setClassname(ejbcClassName); javaTask.setClassname(ejbcClassName);
javaTask.createArg().setLine(additionalArgs); javaTask.createArg().setLine(additionalArgs);
if (keepgenerated) { if (keepgenerated) {
@@ -440,12 +467,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }
javaTask.createArg().setValue(sourceJar.getPath()); javaTask.createArg().setValue(sourceJar.getPath());
javaTask.createArg().setValue(destJar.getPath()); javaTask.createArg().setValue(destJar.getPath());
Path classpath = wlClasspath; Path classpath = wlClasspath;
if (classpath == null) { if (classpath == null) {
classpath = getCombinedClasspath(); classpath = getCombinedClasspath();
} }
javaTask.setFork(true); javaTask.setFork(true);
if (classpath != null) { if (classpath != null) {
javaTask.setClasspath(classpath); javaTask.setClasspath(classpath);
@@ -470,12 +497,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
* filenames/java.io.Files in the Hashtable stored on the instance variable * filenames/java.io.Files in the Hashtable stored on the instance variable
* ejbFiles. * ejbFiles.
*/ */
protected void writeJar(String baseName, File jarFile, Hashtable files,
protected void writeJar(String baseName, File jarFile, Hashtable files,
String publicId) throws BuildException { String publicId) throws BuildException {
// need to create a generic jar first. // need to create a generic jar first.
File genericJarFile = super.getVendorOutputJarFile(baseName); File genericJarFile = super.getVendorOutputJarFile(baseName);
super.writeJar(baseName, genericJarFile, files, publicId); super.writeJar(baseName, genericJarFile, files, publicId);
if (alwaysRebuild || isRebuildRequired(genericJarFile, jarFile)) if (alwaysRebuild || isRebuildRequired(genericJarFile, jarFile))
{ {
buildWeblogicJar(genericJarFile, jarFile, publicId); buildWeblogicJar(genericJarFile, jarFile, publicId);
@@ -495,19 +522,19 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
super.validateConfigured(); super.validateConfigured();
} }


/** /**
* Helper method to check to see if a weblogic EBJ1.1 jar needs to be rebuilt using
* Helper method to check to see if a weblogic EBJ1.1 jar needs to be rebuilt using
* ejbc. Called from writeJar it sees if the "Bean" classes are the only thing that needs * ejbc. 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, * to be updated and either updates the Jar with the Bean classfile or returns true,
* saying that the whole weblogic jar needs to be regened with ejbc. This allows faster
* saying that the whole weblogic jar needs to be regened with ejbc. This allows faster
* build times for working developers. * build times for working developers.
* <p> * <p>
* 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 dicriptors changed, the whole jar needs to be rebuilt with ejbc.
* 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 dicriptors 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 doesnt * This is not strictly true for the xml files. If the JNDI name changes then the jar doesnt
* have to be rebuild, but if the resources references change then it does. At this point the * 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. * weblogic jar gets rebuilt if the xml files change at all.
@@ -523,13 +550,13 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
JarFile wlJar = null; JarFile wlJar = null;
File newWLJarFile = null; File newWLJarFile = null;
JarOutputStream newJarStream = null; JarOutputStream newJarStream = null;
try
try
{ {
log("Checking if weblogic Jar needs to be rebuilt for jar " + weblogicJarFile.getName(), log("Checking if weblogic Jar needs to be rebuilt for jar " + weblogicJarFile.getName(),
Project.MSG_VERBOSE); Project.MSG_VERBOSE);
// Only go forward if the generic and the weblogic file both exist // Only go forward if the generic and the weblogic file both exist
if (genericJarFile.exists() && genericJarFile.isFile()
if (genericJarFile.exists() && genericJarFile.isFile()
&& weblogicJarFile.exists() && weblogicJarFile.isFile()) && weblogicJarFile.exists() && weblogicJarFile.isFile())
{ {
//open jar files //open jar files
@@ -539,7 +566,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
Hashtable genericEntries = new Hashtable(); Hashtable genericEntries = new Hashtable();
Hashtable wlEntries = new Hashtable(); Hashtable wlEntries = new Hashtable();
Hashtable replaceEntries = new Hashtable(); Hashtable replaceEntries = new Hashtable();
//get the list of generic jar entries //get the list of generic jar entries
for (Enumeration e = genericJar.entries(); e.hasMoreElements();) for (Enumeration e = genericJar.entries(); e.hasMoreElements();)
{ {
@@ -604,7 +631,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
break; break;
} }
} }
if (!rebuild) if (!rebuild)
{ {
log("No rebuild needed - updating jar",Project.MSG_VERBOSE); log("No rebuild needed - updating jar",Project.MSG_VERBOSE);
@@ -612,10 +639,10 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
if (newWLJarFile.exists()) { if (newWLJarFile.exists()) {
newWLJarFile.delete(); newWLJarFile.delete();
} }
newJarStream = new JarOutputStream(new FileOutputStream(newWLJarFile)); newJarStream = new JarOutputStream(new FileOutputStream(newWLJarFile));
newJarStream.setLevel(0); newJarStream.setLevel(0);
//Copy files from old weblogic jar //Copy files from old weblogic jar
for (Enumeration e = wlEntries.elements() ; e.hasMoreElements();) for (Enumeration e = wlEntries.elements() ; e.hasMoreElements();)
{ {
@@ -630,7 +657,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
else { else {
newJarStream.setLevel(9); newJarStream.setLevel(9);
} }
// Update with changed Bean class // Update with changed Bean class
if (replaceEntries.containsKey(je.getName())) if (replaceEntries.containsKey(je.getName()))
{ {
@@ -638,7 +665,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
// Use the entry from the generic jar // Use the entry from the generic jar
je = (JarEntry)replaceEntries.get(je.getName()); je = (JarEntry)replaceEntries.get(je.getName());
is = genericJar.getInputStream(je); is = genericJar.getInputStream(je);
}
}
else //use fle from original weblogic jar else //use fle from original weblogic jar
{ {
is = wlJar.getInputStream(je); is = wlJar.getInputStream(je);
@@ -655,7 +682,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
else else
{ {
log("Weblogic Jar rebuild needed due to changed interface or XML",Project.MSG_VERBOSE); log("Weblogic Jar rebuild needed due to changed interface or XML",Project.MSG_VERBOSE);
}
}
} }
else else
{ {
@@ -683,14 +710,14 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
} }
catch (IOException closeException) {} catch (IOException closeException) {}
} }
if (wlJar != null) { if (wlJar != null) {
try { try {
wlJar.close(); wlJar.close();
} }
catch (IOException closeException) {} catch (IOException closeException) {}
} }
if (newJarStream != null) { if (newJarStream != null) {
try { try {
newJarStream.close(); newJarStream.close();
@@ -707,9 +734,9 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {


return rebuild; return rebuild;
} }
/** /**
* Helper method invoked by isRebuildRequired to get a ClassLoader for
* Helper method invoked by isRebuildRequired to get a ClassLoader for
* a Jar File passed to it. * a Jar File passed to it.
* *
* @param classjar java.io.File representing jar file to get classes from. * @param classjar java.io.File representing jar file to get classes from.
@@ -718,12 +745,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
{ {
Path lookupPath = new Path(getTask().getProject()); Path lookupPath = new Path(getTask().getProject());
lookupPath.setLocation(classjar); lookupPath.setLocation(classjar);
Path classpath = getCombinedClasspath(); Path classpath = getCombinedClasspath();
if (classpath != null) { if (classpath != null) {
lookupPath.append(classpath); lookupPath.append(classpath);
} }
return new AntClassLoader(getTask().getProject(), lookupPath); return new AntClassLoader(getTask().getProject(), lookupPath);
} }
} }

Loading…
Cancel
Save