You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2006/11/15 01:13:37 UTC
svn commit: r475080 -
/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/
Author: peterreilly
Date: Tue Nov 14 16:13:36 2006
New Revision: 475080
URL: http://svn.apache.org/viewvc?view=rev&rev=475080
Log:
checkstyle
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/BorlandDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -200,6 +200,11 @@
}
+ /**
+ * 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 @@
* 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 @@
// 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 { }
/**
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DescriptorHandler.java Tue Nov 14 16:13:36 2006
@@ -40,6 +40,7 @@
* 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 @@
}
- /** @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 @@
* @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;
}
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -25,6 +25,9 @@
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
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java Tue Nov 14 16:13:36 2006
@@ -62,7 +62,10 @@
*/
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 @@
}
}
+ /**
+ * get the keep generated attribute.
+ * @return the attribute.
+ */
public boolean getKeepgenerated() {
return keepgenerated;
}
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbcHelper.java Tue Nov 14 16:13:36 2006
@@ -35,7 +35,7 @@
* 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.
*/
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -55,6 +55,11 @@
*
*/
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 @@
// 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 @@
// none to register for generic
}
+ /** {@inheritDoc}. */
public void processDescriptor(String descriptorFileName, SAXParser saxParser) {
checkConfiguration(descriptorFileName, saxParser);
@@ -484,7 +490,7 @@
* 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 @@
*
* 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 @@
/**
* 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 @@
* 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 @@
/**
* 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 {
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -170,6 +170,7 @@
Project.MSG_WARN);
}
+ /** {@inheritDoc}. */
public void processDescriptor(String descriptorName, SAXParser saxParser) {
this.descriptorName = descriptorName;
this.iasDescriptorName = null;
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java Tue Nov 14 16:13:36 2006
@@ -66,6 +66,11 @@
*/
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 @@
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 @@
* @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 @@
* 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 @@
* 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 @@
*
*/
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
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/InnerClassFilenameFilter.java Tue Nov 14 16:13:36 2006
@@ -20,9 +20,16 @@
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 @@
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;
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JbossDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -49,6 +49,8 @@
/**
* 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);
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/JonasDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -326,6 +326,7 @@
/* other methods */
/* ------------- */
+ /** {@inheritDoc}. */
public void processDescriptor(String aDescriptorName, SAXParser saxParser) {
descriptorName = aDescriptorName;
@@ -342,6 +343,7 @@
}
}
+ /** {@inheritDoc}. */
protected void writeJar(String baseName, File jarfile, Hashtable ejbFiles, String publicId)
throws BuildException {
@@ -361,6 +363,7 @@
}
}
+ /** {@inheritDoc}. */
protected void addVendorFiles(Hashtable ejbFiles, String ddPrefix) {
// JOnAS-specific descriptor deployment
@@ -375,6 +378,7 @@
}
}
+ /** {@inheritDoc}. */
protected File getVendorOutputJarFile(String baseName) {
return new File(getDestDir(), baseName + suffix);
}
@@ -451,6 +455,7 @@
return jonasDN;
}
+ /** {@inheritDoc}. */
protected String getJarBaseName(String descriptorFileName) {
String baseName = null;
@@ -491,6 +496,7 @@
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 @@
* @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 @@
+ 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 @@
// verbose
if (verbose) {
genicTask.createArg().setValue("-verbose");
- }
+ }
// additionalargs
if (additionalargs != null) {
@@ -653,8 +655,9 @@
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 @@
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 {
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -397,6 +397,10 @@
}
+ /**
+ * 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 @@
}
+ /**
+ * 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 @@
/**
* 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 @@
* 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 @@
* @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 @@
//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 @@
|| je.getCompressedSize() == je.getSize()) {
newJarStream.setLevel(0);
} else {
- newJarStream.setLevel(9);
+ newJarStream.setLevel(JAR_COMPRESS_LEVEL);
}
// Update with changed Bean class
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicTOPLinkDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -23,6 +23,9 @@
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 @@
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 @@
/**
* 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);
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java?view=diff&rev=475080&r1=475079&r2=475080
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java Tue Nov 14 16:13:36 2006
@@ -59,6 +59,7 @@
*
*/
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 @@
}
}
-
- /**
- * 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 @@
//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 @@
|| je.getCompressedSize() == je.getSize()) {
newJarStream.setLevel(0);
} else {
- newJarStream.setLevel(9);
+ newJarStream.setLevel(JAR_COMPRESS_LEVEL);
}
// Update with changed Bean class
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org