diff options
Diffstat (limited to 'src/main')
14 files changed, 148 insertions, 46 deletions
diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java index 55063e5f4..de68b6fc8 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java @@ -200,6 +200,11 @@ public class BorlandDeploymentTool extends GenericDeploymentTool } + /** + * Get the borland descriptor handler. + * @param srcDir the source directory. + * @return the descriptor. + */ protected DescriptorHandler getBorlandDescriptorHandler(final File srcDir) { DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) { @@ -444,6 +449,11 @@ public class BorlandDeploymentTool extends GenericDeploymentTool * Method used to encapsulate the writing of the JAR file. Iterates over the * filenames/java.io.Files in the Hashtable stored on the instance variable * ejbFiles. + * @param baseName the base name. + * @param jarFile the jar file to write to. + * @param files the files to write to the jar. + * @param publicId the id to use. + * @throws BuildException if there is an error. */ protected void writeJar(String baseName, File jarFile, Hashtable files, String publicId) throws BuildException { @@ -500,8 +510,11 @@ public class BorlandDeploymentTool extends GenericDeploymentTool // implementation of org.apache.tools.ant.taskdefs.ExecuteStreamHandler interface + /** {@inheritDoc}. */ public void start() throws IOException { } + /** {@inheritDoc}. */ public void stop() { } + /** {@inheritDoc}. */ public void setProcessInputStream(OutputStream param1) throws IOException { } /** diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java index 9e1ebac75..e8392605b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java @@ -40,6 +40,7 @@ import org.xml.sax.SAXException; * list can then be accessed through the getFiles() method. */ public class DescriptorHandler extends org.xml.sax.HandlerBase { + private static final int DEFAULT_HASH_TABLE_SIZE = 10; private static final int STATE_LOOKING_EJBJAR = 1; private static final int STATE_IN_EJBJAR = 2; private static final int STATE_IN_BEANS = 3; @@ -171,7 +172,16 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { } - /** @see org.xml.sax.EntityResolver#resolveEntity(String, String) */ + /** + * Resolve the entity. + * @see org.xml.sax.EntityResolver#resolveEntity(String, String). + * @param publicId The public identifier, or <code>null</code> + * if none is available. + * @param systemId The system identifier provided in the XML + * document. Will not be <code>null</code>. + * @return an inputsource for this identifier + * @throws SAXException if there is a problem. + */ public InputSource resolveEntity(String publicId, String systemId) throws SAXException { this.publicId = publicId; @@ -245,7 +255,7 @@ public class DescriptorHandler extends org.xml.sax.HandlerBase { * @throws SAXException on error */ public void startDocument() throws SAXException { - this.ejbFiles = new Hashtable(10, 1); + this.ejbFiles = new Hashtable(DEFAULT_HASH_TABLE_SIZE, 1); this.currentElement = null; inEJBRef = false; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java index c42b2a83e..d6006d6c7 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java @@ -25,6 +25,9 @@ import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Task; +/** + * The interface to implement for deployment tools. + */ public interface EJBDeploymentTool { /** * Process a deployment descriptor, generating the necessary vendor specific diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java index 3d3f665f2..239669e7e 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java @@ -62,7 +62,10 @@ public class Ejbc extends MatchingTask { */ private File sourceDirectory; + // CheckStyle:VisibilityModifier OFF - bc + /** Whether to keep the generated files */ public boolean keepgenerated; + // CheckStyle:VisibilityModifier ON /** * Do the work. @@ -124,6 +127,10 @@ public class Ejbc extends MatchingTask { } } + /** + * get the keep generated attribute. + * @return the attribute. + */ public boolean getKeepgenerated() { return keepgenerated; } diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java index ee473897c..7dea01afc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java @@ -35,7 +35,7 @@ import javax.ejb.deployment.EntityDescriptor; * interface class files referenced in the deployment descriptors being processed. * */ -public class EjbcHelper { +public final class EjbcHelper { /** * The root directory of the tree containing the serialised deployment desciptors. */ diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java index bdca4f7aa..828af1594 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java @@ -55,6 +55,11 @@ import org.xml.sax.SAXException; * */ public class GenericDeploymentTool implements EJBDeploymentTool { + /** The default buffer byte size to use for IO */ + public static final int DEFAULT_BUFFER_SIZE = 1024; + /** The level to use for compression */ + public static final int JAR_COMPRESS_LEVEL = 9; + /** The standard META-INF directory in jar files */ protected static final String META_DIR = "META-INF/"; @@ -331,7 +336,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { // Create the file input stream, and buffer everything over // to the jar output stream - byte[] byteBuffer = new byte[2 * 1024]; + byte[] byteBuffer = new byte[2 * DEFAULT_BUFFER_SIZE]; int count = 0; do { jStream.write(byteBuffer, 0, count); @@ -387,6 +392,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { // none to register for generic } + /** {@inheritDoc}. */ public void processDescriptor(String descriptorFileName, SAXParser saxParser) { checkConfiguration(descriptorFileName, saxParser); @@ -484,7 +490,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { * descriptor to be processed * @param saxParser SAXParser which may be used to parse the XML * descriptor - * @exception BuildException Thrown if the configuration is invalid + * @throws BuildException if there is a problem. */ protected void checkConfiguration(String descriptorFileName, SAXParser saxParser) throws BuildException { @@ -628,6 +634,9 @@ public class GenericDeploymentTool implements EJBDeploymentTool { * * This will contain the path and the start of the descriptor name, * depending on the naming scheme + * @param baseName the base name to use. + * @param descriptorFileName the file name to use. + * @return the prefix. */ public String getVendorDDPrefix(String baseName, String descriptorFileName) { String ddPrefix = null; @@ -662,6 +671,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { /** * 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. + * @param baseName the basename to use. */ File getVendorOutputJarFile(String baseName) { return new File(destDir, baseName + genericJarSuffix); @@ -743,6 +753,11 @@ public class GenericDeploymentTool implements EJBDeploymentTool { * Method used to encapsulate the writing of the JAR file. Iterates over the * filenames/java.io.Files in the Hashtable stored on the instance variable * ejbFiles. + * @param baseName the base name to use. + * @param jarfile the jar file to write to. + * @param files the files to write to the jar. + * @param publicId the id to use. + * @throws BuildException if there is a problem. */ protected void writeJar(String baseName, File jarfile, Hashtable files, String publicId) throws BuildException { @@ -857,6 +872,7 @@ public class GenericDeploymentTool implements EJBDeploymentTool { /** * Add all available classes, that depend on Remote, Home, Bean, PK * @param checkEntries files, that are extracted from the deployment descriptor + * @throws BuildException if there is a problem. */ protected void checkAndAddDependants(Hashtable checkEntries) throws BuildException { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java index 2d209d533..c64ca0e65 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java @@ -170,6 +170,7 @@ public class IPlanetDeploymentTool extends GenericDeploymentTool { Project.MSG_WARN); } + /** {@inheritDoc}. */ public void processDescriptor(String descriptorName, SAXParser saxParser) { this.descriptorName = descriptorName; this.iasDescriptorName = null; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java index 936e97508..dba8006ef 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java @@ -66,6 +66,11 @@ import org.xml.sax.SAXException; */ public class IPlanetEjbc { + private static final int MIN_NUM_ARGS = 2; + private static final int MAX_NUM_ARGS = 8; + private static final int NUM_CLASSES_WITH_IIOP = 15; + private static final int NUM_CLASSES_WITHOUT_IIOP = 9; + /* Constants used for the "beantype" attribute */ private static final String ENTITY_BEAN = "entity"; private static final String STATELESS_SESSION = "stateless"; @@ -254,7 +259,7 @@ public class IPlanetEjbc { boolean retainSource = false; IPlanetEjbc ejbc; - if ((args.length < 2) || (args.length > 8)) { + if ((args.length < MIN_NUM_ARGS) || (args.length > MAX_NUM_ARGS)) { usage(); return; } @@ -602,6 +607,18 @@ public class IPlanetEjbc { * @see IPlanetEjbc.EjbInfo */ private class EjbcHandler extends HandlerBase { + /** EJB 1.1 ID */ + private static final String PUBLICID_EJB11 = + "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"; + /** IPlanet ID */ + private static final String PUBLICID_IPLANET_EJB_60 = + "-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"; + /** EJB 1.1 location */ + private static final String DEFAULT_IAS60_EJB11_DTD_LOCATION = + "ejb-jar_1_1.dtd"; + /** IAS60 location */ + private static final String DEFAULT_IAS60_DTD_LOCATION = + "IASEjb_jar_1_0.dtd"; /* * Two Maps are used to track local DTDs that will be used in case the @@ -625,21 +642,6 @@ public class IPlanetEjbc { * descriptor DTD. */ public EjbcHandler() { - /** EJB 1.1 ID */ - final String PUBLICID_EJB11 = - "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"; - /** IPlanet ID */ - final String PUBLICID_IPLANET_EJB_60 = - "-//Sun Microsystems, Inc.//DTD iAS Enterprise JavaBeans 1.0//EN"; - - - /** EJB 1.1 location */ - final String DEFAULT_IAS60_EJB11_DTD_LOCATION = - "ejb-jar_1_1.dtd"; - /** IAS60 location */ - final String DEFAULT_IAS60_DTD_LOCATION = - "IASEjb_jar_1_0.dtd"; - registerDTD(PUBLICID_EJB11, DEFAULT_IAS60_EJB11_DTD_LOCATION); registerDTD(PUBLICID_IPLANET_EJB_60, DEFAULT_IAS60_DTD_LOCATION); } @@ -1271,7 +1273,9 @@ public class IPlanetEjbc { * names for the stubs and skeletons to be generated. */ private String[] classesToGenerate() { - String[] classnames = (iiop) ? new String[15] : new String[9]; + String[] classnames = (iiop) + ? new String[NUM_CLASSES_WITH_IIOP] + : new String[NUM_CLASSES_WITHOUT_IIOP]; final String remotePkg = remote.getPackageName() + "."; final String remoteClass = remote.getClassName(); @@ -1448,7 +1452,8 @@ public class IPlanetEjbc { * */ private static class RedirectOutput extends Thread { - InputStream stream; // Stream to read and redirect to standard output + + private InputStream stream; // Stream to read and redirect to standard output /** * Constructs a new instance that will redirect output from the diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java index 10ec3b190..e92d98796 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java @@ -20,9 +20,16 @@ package org.apache.tools.ant.taskdefs.optional.ejb; import java.io.File; import java.io.FilenameFilter; +/** + * A filename filter for inner class files of a particular class. + */ public class InnerClassFilenameFilter implements FilenameFilter { private String baseClassName; + /** + * Constructor of filter. + * @param baseclass the class to filter inner classes on. + */ InnerClassFilenameFilter(String baseclass) { int extidx = baseclass.lastIndexOf(".class"); if (extidx == -1) { @@ -31,7 +38,13 @@ public class InnerClassFilenameFilter implements FilenameFilter { baseClassName = baseclass.substring(0, extidx); } - public boolean accept(File Dir, String filename) { + /** + * Check if the file name passes the filter. + * @param dir not used. + * @param filename the filename to filter on. + * @return true if the filename is an inner class of the base class. + */ + public boolean accept(File dir, String filename) { if ((filename.lastIndexOf(".") != filename.lastIndexOf(".class")) || (filename.indexOf(baseClassName + "$") != 0)) { return false; diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java index fde83176f..a0286b1e5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java @@ -49,6 +49,8 @@ public class JbossDeploymentTool extends GenericDeploymentTool { /** * Add any vendor specific files which should be included in the * EJB Jar. + * @param ejbFiles the hashtable of files to populate. + * @param ddPrefix the prefix to use. */ protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { File jbossDD = new File(getConfig().descriptorDir, ddPrefix + JBOSS_DD); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java index d95be167e..c8c1f6252 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java @@ -326,6 +326,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { /* other methods */ /* ------------- */ + /** {@inheritDoc}. */ public void processDescriptor(String aDescriptorName, SAXParser saxParser) { descriptorName = aDescriptorName; @@ -342,6 +343,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { } } + /** {@inheritDoc}. */ protected void writeJar(String baseName, File jarfile, Hashtable ejbFiles, String publicId) throws BuildException { @@ -361,6 +363,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { } } + /** {@inheritDoc}. */ protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { // JOnAS-specific descriptor deployment @@ -375,6 +378,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { } } + /** {@inheritDoc}. */ protected File getVendorOutputJarFile(String baseName) { return new File(getDestDir(), baseName + suffix); } @@ -451,6 +455,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { return jonasDN; } + /** {@inheritDoc}. */ protected String getJarBaseName(String descriptorFileName) { String baseName = null; @@ -491,6 +496,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { return baseName; } + /** {@inheritDoc}. */ protected void registerKnownDTDs(DescriptorHandler handler) { handler.registerDTD(EJB_JAR_1_1_PUBLIC_ID, jonasroot + File.separator + "xml" + File.separator + EJB_JAR_1_1_DTD); @@ -509,14 +515,11 @@ public class JonasDeploymentTool extends GenericDeploymentTool { * @param genericJarFile jar file. * @param ejbFiles the hashtable. */ - private void addGenICGeneratedFiles(File genericJarFile, Hashtable ejbFiles) { - // GenIC task - Java genicTask = null; - - // GenIC class (3 GenIC classes for various versions of JOnAS - // are supported) - String genicClass = null; - + private void addGenICGeneratedFiles( + File genericJarFile, Hashtable ejbFiles) { + Java genicTask = null; // GenIC task + String genicClass = null; // GenIC class (3 are supported for various + // versions if (nogenic) { return; } @@ -573,7 +576,6 @@ public class JonasDeploymentTool extends GenericDeploymentTool { + File.separator + orb + "_jonas.jar"; classpath.append(new Path(classpath.getProject(), orbJar)); } - log("Using classpath: " + classpath.toString(), Project.MSG_VERBOSE); genicTask.setClasspath(classpath); @@ -628,7 +630,7 @@ public class JonasDeploymentTool extends GenericDeploymentTool { // verbose if (verbose) { genicTask.createArg().setValue("-verbose"); - } + } // additionalargs if (additionalargs != null) { @@ -653,8 +655,9 @@ public class JonasDeploymentTool extends GenericDeploymentTool { deleteAllFiles(outputdir); if (!keepgeneric) { - log("Deleting generic JAR " + genericJarFile.toString(), Project.MSG_VERBOSE); - genericJarFile.delete(); + log("Deleting generic JAR " + genericJarFile.toString(), + Project.MSG_VERBOSE); + genericJarFile.delete(); } throw new BuildException("GenIC reported an error."); @@ -716,6 +719,12 @@ public class JonasDeploymentTool extends GenericDeploymentTool { return null; } + /** + * Verify the configuration. + * @param descriptorFileName the name of the descriptor file. + * @param saxParser not used. + * @throws BuildException if there is an error. + */ protected void checkConfiguration(String descriptorFileName, SAXParser saxParser) throws BuildException { diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java index 61738d164..cc73b0563 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java @@ -397,6 +397,10 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { } + /** + * Register the DTDs. + * @param handler the handler to use. + */ protected void registerKnownDTDs(DescriptorHandler handler) { // register all the known DTDs handler.registerDTD(PUBLICID_EJB11, DEFAULT_WL51_EJB11_DTD_LOCATION); @@ -406,6 +410,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { } + /** + * Get the weblogic descriptor handler. + * @param srcDir the source directory. + * @return the descriptor. + */ protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) { DescriptorHandler handler = new DescriptorHandler(getTask(), srcDir) { @@ -442,6 +451,8 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { /** * Add any vendor specific files which should be included in the EJB Jar. + * @param ejbFiles the hash table to be populated. + * @param ddPrefix the prefix to use. */ protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { File weblogicDD = new File(getConfig().descriptorDir, ddPrefix + WL_DD); @@ -637,6 +648,11 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { * Method used to encapsulate the writing of the JAR file. Iterates over * the filenames/java.io.Files in the Hashtable stored on the instance * variable ejbFiles. + * @param baseName the base name. + * @param jarFile the jar file to populate. + * @param files the hash table of files to write. + * @param publicId the id to use. + * @throws BuildException if there is a problem. */ protected void writeJar(String baseName, File jarFile, Hashtable files, String publicId) throws BuildException { @@ -688,6 +704,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { * @param genericJarFile java.io.File The generic jar file. * @param weblogicJarFile java.io.File The weblogic jar file to check to * see if it needs to be rebuilt. + * @return true if the jar needs to be rebuilt. */ protected boolean isRebuildRequired(File genericJarFile, File weblogicJarFile) { boolean rebuild = false; @@ -793,7 +810,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { //Copy files from old weblogic jar for (Enumeration e = wlEntries.elements(); e.hasMoreElements();) { - byte[] buffer = new byte[1024]; + byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int bytesRead; InputStream is; JarEntry je = (JarEntry) e.nextElement(); @@ -802,7 +819,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool { || je.getCompressedSize() == je.getSize()) { newJarStream.setLevel(0); } else { - newJarStream.setLevel(9); + newJarStream.setLevel(JAR_COMPRESS_LEVEL); } // Update with changed Bean class diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java index 6a572d37e..2ee69d0de 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java @@ -23,6 +23,9 @@ import java.util.Hashtable; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.Project; +/** + * Deployment tool for Weblogic TOPLink. + */ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { private static final String TL_DTD_LOC @@ -53,6 +56,11 @@ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { this.toplinkDTD = inString; } + /** + * Get the descriptor handler. + * @param srcDir the source file. + * @return the descriptor handler. + */ protected DescriptorHandler getDescriptorHandler(File srcDir) { DescriptorHandler handler = super.getDescriptorHandler(srcDir); if (toplinkDTD != null) { @@ -68,6 +76,8 @@ public class WeblogicTOPLinkDeploymentTool extends WeblogicDeploymentTool { /** * Add any vendor specific files which should be included in the * EJB Jar. + * @param ejbFiles the hashtable to add files to. + * @param ddPrefix the prefix to use. */ protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) { super.addVendorFiles(ejbFiles, ddPrefix); diff --git a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java index 7f542863f..c46aaf62b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java +++ b/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java @@ -59,6 +59,7 @@ import org.apache.tools.ant.util.FileUtils; * */ public class WebsphereDeploymentTool extends GenericDeploymentTool { + /** ID for ejb 1.1 */ public static final String PUBLICID_EJB11 = "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN"; @@ -608,12 +609,7 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { } } - - /** - * Method used to encapsulate the writing of the JAR file. Iterates over - * the filenames/java.io.Files in the Hashtable stored on the instance - * variable ejbFiles. - */ + /** {@inheritDoc}. */ protected void writeJar(String baseName, File jarFile, Hashtable files, String publicId) throws BuildException { if (ejbdeploy) { @@ -782,7 +778,7 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { //Copy files from old websphere jar for (Enumeration e = wasEntries.elements(); e.hasMoreElements();) { - byte[] buffer = new byte[1024]; + byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; int bytesRead; InputStream is; JarEntry je = (JarEntry) e.nextElement(); @@ -791,7 +787,7 @@ public class WebsphereDeploymentTool extends GenericDeploymentTool { || je.getCompressedSize() == je.getSize()) { newJarStream.setLevel(0); } else { - newJarStream.setLevel(9); + newJarStream.setLevel(JAR_COMPRESS_LEVEL); } // Update with changed Bean class |