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-ffa450edef68master
| @@ -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) { | public void processDescriptor(String descriptorFileName, SAXParser saxParser) { | ||||
| FileInputStream descriptorStream = null; | FileInputStream descriptorStream = null; | ||||
| @@ -255,23 +255,12 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { | |||||
| this.newCMP = newCMP; | 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_WL51_EJB11_DTD_LOCATION); | ||||
| handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL60_EJB11_DTD_LOCATION); | handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL60_EJB11_DTD_LOCATION); | ||||
| handler.registerDTD(PUBLICID_EJB11, ejb11DTD); | handler.registerDTD(PUBLICID_EJB11, ejb11DTD); | ||||
| handler.registerDTD(PUBLICID_EJB20, DEFAULT_WL60_EJB20_DTD_LOCATION); | 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) { | protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) { | ||||