ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb EJBDeploymentTool.java EjbJar.java GenericDeploymentTool.java WeblogicDeploymentTool.java
Date Mon, 12 Feb 2001 13:28:05 GMT
conor       01/02/12 05:28:05

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb Tag:
                        ANT_13_BRANCH EJBDeploymentTool.java EjbJar.java
                        GenericDeploymentTool.java
                        WeblogicDeploymentTool.java
  Log:
  A number of fixes for <ejbjar> and friends
  
  - Make DTDs actually work
  - Allow multiple support filesets
  - Add a default manifest to the generic jar (Thanks to
    fern@interdimensions.com) for pointing that out.
  - Introduce newCMP attribute in place of oldCMP though
    the latter still works
  - Add a wlclasspath attribute in addition to nested
    element
  - Add DTD lookups to the weblogic CMP handling
  - Look for CMP descriptors in the same directory as
    the current weblogic descriptor.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.7.2.1   +0 -2      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java
  
  Index: EJBDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EJBDeploymentTool.java,v
  retrieving revision 1.7
  retrieving revision 1.7.2.1
  diff -u -r1.7 -r1.7.2.1
  --- EJBDeploymentTool.java	2001/01/25 14:39:16	1.7
  +++ EJBDeploymentTool.java	2001/02/12 13:28:04	1.7.2.1
  @@ -69,8 +69,6 @@
        *
        * @param descriptorFilename the name of the deployment descriptor
        * @param saxParser a SAX parser which can be used to parse the deployment descriptor.

  -     * @param supportFileSet a fileset containing all the files to be included in the 
  -     * `                     generated jarfile as support classes.
        */
       public void processDescriptor(String descriptorFilename, SAXParser saxParser) 
           throws BuildException;
  
  
  
  1.13.2.1  +5 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java
  
  Index: EjbJar.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/EjbJar.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- EjbJar.java	2001/01/25 14:39:16	1.13
  +++ EjbJar.java	2001/02/12 13:28:04	1.13.2.1
  @@ -103,7 +103,7 @@
    */
   public class EjbJar extends MatchingTask {
       
  -    static class DTDLocation {
  +    public static class DTDLocation {
           private String publicId;
           private String location;
           
  @@ -155,7 +155,7 @@
           /**
            * A Fileset of support classes
            */
  -        public FileSet supportFileSet = null;
  +        public List supportFileSets = new ArrayList();
           
           /**
            * The list of configured DTD locations
  @@ -238,8 +238,9 @@
        * @return a fileset which can be populated with support files.
        */
       public FileSet createSupport() {
  -        config.supportFileSet = new FileSet();
  -        return config.supportFileSet;
  +        FileSet supportFileSet = new FileSet();
  +        config.supportFileSets.add(supportFileSet);
  +        return supportFileSet;
       }
       
   
  
  
  
  1.13.2.1  +15 -7     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java
  
  Index: GenericDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/GenericDeploymentTool.java,v
  retrieving revision 1.13
  retrieving revision 1.13.2.1
  diff -u -r1.13 -r1.13.2.1
  --- GenericDeploymentTool.java	2001/01/25 14:39:16	1.13
  +++ GenericDeploymentTool.java	2001/02/12 13:28:04	1.13.2.1
  @@ -289,14 +289,15 @@
               Hashtable ejbFiles = handler.getFiles();
                       
               // add in support classes if any
  -            if (config.supportFileSet != null) {
  -                Project project = task.getProject();
  -                File supportBaseDir = config.supportFileSet.getDir(project);
  -                DirectoryScanner supportScanner = config.supportFileSet.getDirectoryScanner(project);
  +            Project project = task.getProject();
  +            for (Iterator i = config.supportFileSets.iterator(); i.hasNext();) {
  +                FileSet supportFileSet = (FileSet)i.next();
  +                File supportBaseDir = supportFileSet.getDir(project);
  +                DirectoryScanner supportScanner = supportFileSet.getDirectoryScanner(project);
                   supportScanner.scan();
                   String[] supportFiles = supportScanner.getIncludedFiles();
  -                for (int i = 0; i < supportFiles.length; ++i) {
  -                    ejbFiles.put(supportFiles[i], new File(supportBaseDir, supportFiles[i]));
  +                for (int j = 0; j < supportFiles.length; ++j) {
  +                    ejbFiles.put(supportFiles[j], new File(supportBaseDir, supportFiles[j]));
                   }
               }            
   
  @@ -455,9 +456,16 @@
               jarfile.getParentFile().mkdirs();
               jarfile.createNewFile();
               
  +            String defaultManifest = "/org/apache/tools/ant/defaultManifest.mf";
  +            InputStream in = this.getClass().getResourceAsStream(defaultManifest);
  +            if ( in == null ) {
  +                throw new BuildException ( "Could not find: " + defaultManifest );
  +            }
  +            
  +            Manifest manifest = new Manifest(in);
               // Create the streams necessary to write the jarfile
               
  -            jarStream = new JarOutputStream(new FileOutputStream(jarfile));
  +            jarStream = new JarOutputStream(new FileOutputStream(jarfile), manifest);
               jarStream.setMethod(JarOutputStream.DEFLATED);
               
               // Loop through all the class files found and add them to the jar
  
  
  
  1.16.2.1  +27 -10    jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.16
  retrieving revision 1.16.2.1
  diff -u -r1.16 -r1.16.2.1
  --- WeblogicDeploymentTool.java	2001/02/04 08:30:44	1.16
  +++ WeblogicDeploymentTool.java	2001/02/12 13:28:04	1.16.2.1
  @@ -112,10 +112,10 @@
       /**
        * Indicates if the old CMP location convention is to be used.
        */
  -    private boolean oldCMP = true;
  +    private boolean newCMP = false;
   
       /** The classpath to the weblogic classes. */
  -    private Path wlClasspath;
  +    private Path wlClasspath = null;
   
       /**
        * Get the classpath to the weblogic classpaths
  @@ -126,6 +126,10 @@
           }
           return wlClasspath.createPath();
       }
  +    
  +    public void setWLClasspath(Path wlClasspath) {
  +        this.wlClasspath = wlClasspath;
  +    }
   
       /**
        * The compiler (switch <code>-compiler</code>) to use
  @@ -203,8 +207,16 @@
           this.ejb11DTD = inString;
       }
   
  +    /**
  +     * Set the value of the oldCMP scheme. This is an antonym for
  +     * newCMP
  +     */
  +    public void setOldCMP(boolean oldCMP) {
  +        this.newCMP = !oldCMP;
  +    }
  +    
       /**
  -     * Set the value of the oldCMP scheme. The oldCMP scheme locates the 
  +     * Set the value of the newCMP scheme. The old CMP scheme locates the 
        * weblogic CMP descriptor based on the naming convention where the 
        * weblogic CMP file is expected to be named with the bean name as the prefix.
        * 
  @@ -212,10 +224,9 @@
        * actually used in the main weblogic EJB descriptor. Also, descriptors which 
        * contain multiple CMP references could not be used.
        *
  -     * The old scheme is currently the default, but is also deprecated.
        */
  -    public void setOldCMP(boolean oldCMP) {
  -        this.oldCMP = oldCMP;
  +    public void setNewCMP(boolean newCMP) {
  +        this.newCMP = newCMP;
       }
       
   
  @@ -237,7 +248,7 @@
           return handler;                                    
       }
   
  -    protected DescriptorHandler getWeblogicDescriptorHandler(File srcDir) {
  +    protected DescriptorHandler getWeblogicDescriptorHandler(final File srcDir) {
           DescriptorHandler handler = 
               new DescriptorHandler(srcDir) {        
                   protected void processElement() {
  @@ -247,7 +258,8 @@
                           //trim the META_INF\ off of the file name
                           String fileName = fileNameWithMETA.substring(META_DIR.length(),

                                                                        fileNameWithMETA.length()
);
  -                        File descriptorFile = new File(getConfig().descriptorDir, fileName);
  +                        File descriptorFile = new File(srcDir, fileName);
  +                        
                           ejbFiles.put(fileNameWithMETA, descriptorFile);
                       }
                   }
  @@ -255,6 +267,11 @@
   
           handler.registerDTD(PUBLICID_WEBLOGIC_EJB, 
                               weblogicDTD == null ? DEFAULT_WL_DTD_LOCATION : weblogicDTD);
  +                            
  +        for (Iterator i = getConfig().dtdLocations.iterator(); i.hasNext();) {
  +            EjbJar.DTDLocation dtdLocation = (EjbJar.DTDLocation)i.next();
  +            handler.registerDTD(dtdLocation.getPublicId(), dtdLocation.getLocation());
  +        }
           return handler;                                    
       }
   
  @@ -277,9 +294,9 @@
               return;
           }
   
  -        if (oldCMP) {
  +        if (!newCMP) {
               log("The old method for locating CMP files has been DEPRECATED.", Project.MSG_VERBOSE);
  -            log("Please adjust your weblogic descriptor and set oldCMP=\"false\" " +
  +            log("Please adjust your weblogic descriptor and set newCMP=\"true\" " +
                   "to use the new CMP descriptor inclusion mechanism. ", Project.MSG_VERBOSE);
               // The the weblogic cmp deployment descriptor
               File weblogicCMPDD = new File(getConfig().descriptorDir, ddPrefix + WL_CMP_DD);
  
  
  

Mime
View raw message