1 18 19 package org.apache.tools.ant.taskdefs.optional.ejb; 20 21 import java.io.File ; 22 import java.util.Hashtable ; 23 import org.apache.tools.ant.BuildException; 24 import org.apache.tools.ant.Project; 25 26 29 public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { 30 31 private static final String TL_DTD_LOC 32 = "http://www.objectpeople.com/tlwl/dtd/toplink-cmp_2_5_1.dtd"; 33 34 private String toplinkDescriptor; 35 private String toplinkDTD; 36 37 41 public void setToplinkdescriptor(String inString) { 42 this.toplinkDescriptor = inString; 43 } 44 45 55 public void setToplinkdtd(String inString) { 56 this.toplinkDTD = inString; 57 } 58 59 64 protected DescriptorHandler getDescriptorHandler(File srcDir) { 65 DescriptorHandler handler = super.getDescriptorHandler(srcDir); 66 if (toplinkDTD != null) { 67 handler.registerDTD("-//The Object People, Inc.//" 68 + "DTD TOPLink for WebLogic CMP 2.5.1//EN", toplinkDTD); 69 } else { 70 handler.registerDTD("-//The Object People, Inc.//" 71 + "DTD TOPLink for WebLogic CMP 2.5.1//EN", TL_DTD_LOC); 72 } 73 return handler; 74 } 75 76 82 protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { 83 super.addVendorFiles(ejbFiles, ddPrefix); 84 86 88 89 File toplinkDD = new File (getConfig().descriptorDir, ddPrefix + toplinkDescriptor); 90 91 if (toplinkDD.exists()) { 92 ejbFiles.put(META_DIR + toplinkDescriptor, 93 toplinkDD); 94 } else { 95 log("Unable to locate toplink deployment descriptor. " 96 + "It was expected to be in " 97 + toplinkDD.getPath(), Project.MSG_WARN); 98 } 99 } 100 101 105 public void validateConfigured() throws BuildException { 106 super.validateConfigured(); 107 if (toplinkDescriptor == null) { 108 throw new BuildException("The toplinkdescriptor attribute must " 109 + "be specified"); 110 } 111 } 112 } 113 | Popular Tags |