Browse Source

Define DTDs for the generic cae and not just the weblogic case

I took Robert's patch and refactored it a little to avoid
duplicating the code in the weblogic deployment descriptor.

Submitted by:	Robert Watkins [robert.watkins@qsipayments.com]


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268824 13f79535-47bb-0310-9956-ffa450edef68
master
Conor MacNeill 24 years ago
parent
commit
f71b0b0295
2 changed files with 24 additions and 16 deletions
  1. +22
    -3
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  2. +2
    -13
      src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java

+ 22
- 3
src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java View File

@@ -269,10 +269,29 @@ public class GenericDeploymentTool implements EJBDeploymentTool {
}
}

protected DescriptorHandler getDescriptorHandler(File srcDir) {
return new DescriptorHandler(task, srcDir);
}
protected DescriptorHandler getDescriptorHandler(File srcDir) {
DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir);
registerKnownDTDs(handler);
// register any DTDs supplied by the user
for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
}
return handler;
}
/**
* Register the locations of all known DTDs.
*
* vendor-specific subclasses should override this method to define
* the vendor-specific locations of the EJB DTDs
*/
protected void registerKnownDTDs(DescriptorHandler handler) {
// none to register for generic
}

public void processDescriptor(String descriptorFileName, SAXParser saxParser) {
FileInputStream descriptorStream = null;



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

@@ -255,23 +255,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool {
this.newCMP = newCMP;
}

protected DescriptorHandler getDescriptorHandler(File srcDir) {
DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir);
// register all the DTDs, both the ones that are known and
// any supplied by the user
protected void registerKnownDTDs(DescriptorHandler handler) {
// register all the known DTDs
handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL51_EJB11_DTD_LOCATION);
handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL60_EJB11_DTD_LOCATION);
handler.registerDTD(PUBLICID_EJB11, ejb11DTD);
handler.registerDTD(PUBLICID_EJB20, DEFAULT_WL60_EJB20_DTD_LOCATION);
for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
handler.registerDTD(dtdLocation.getPublicId(),
dtdLocation.getLocation());
}
return handler;
}

protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) {


Loading…
Cancel
Save