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 IPlanetEjbc.java
Date Tue, 08 Jan 2002 09:33:39 GMT
conor       02/01/08 01:33:39

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        IPlanetEjbc.java
  Log:
  Add Primary Key capability to iPlanet deployment tool
  
  Submitted by:	Paul Spillman <Paul.Spillman@Sun.COM>
  
  Revision  Changes    Path
  1.4       +39 -0     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java
  
  Index: IPlanetEjbc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/ejb/IPlanetEjbc.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- IPlanetEjbc.java	27 Nov 2001 18:04:52 -0000	1.3
  +++ IPlanetEjbc.java	8 Jan 2002 09:33:39 -0000	1.4
  @@ -878,6 +878,8 @@
                   currentEjb.setRemote(value);
               } else if (currentLoc.equals(base + "\\ejb-class")) {
                   currentEjb.setImplementation(value);
  +            } else if (currentLoc.equals(base + "\\prim-key-class")) {
  +                currentEjb.setPrimaryKey(value);
               } else if (currentLoc.equals(base + "\\session-type")) {
                   currentEjb.setBeantype(value);
               } else if (currentLoc.equals(base + "\\persistence-type")) {
  @@ -927,6 +929,7 @@
           private Classname  home;              // EJB's home interface name
           private Classname  remote;            // EJB's remote interface name
           private Classname  implementation;      // EJB's implementation class
  +        private Classname  primaryKey;        // EJB's primary key class
           private String  beantype = "entity";  // or "stateful" or "stateless"
           private boolean cmp       = false;      // Does this EJB support CMP?
           private boolean iiop      = false;      // Does this EJB support IIOP?
  @@ -1004,6 +1007,18 @@
               return implementation;
           }
   
  +        public void setPrimaryKey(String primaryKey) {
  +            setPrimaryKey(new Classname(primaryKey));
  +        }
  +
  +        public void setPrimaryKey(Classname primaryKey) {
  +            this.primaryKey = primaryKey;
  +        }
  +
  +        public Classname getPrimaryKey() {
  +            return primaryKey;
  +        }
  +
           public void setBeantype(String beantype) {
               this.beantype = beantype.toLowerCase();
           }
  @@ -1158,6 +1173,7 @@
               File remoteFile;     // File for the remote interface class
               File homeFile;       // File for the home interface class
               File implFile;       // File for the EJB implementation class
  +            File pkFile;         // File for the EJB primary key class
   
               /* Check the timestamp on the remote interface */
               remoteFile = remote.getClassFile(buildDir);
  @@ -1181,6 +1197,22 @@
               }
               latestModified = Math.max(latestModified, modified);
   
  +            /* Check the timestamp of the primary key class */
  +            if (primaryKey != null) {
  +                pkFile = primaryKey.getClassFile(buildDir);
  +                modified = pkFile.lastModified();
  +                if (modified == -1) {
  +                    System.out.println("The class "
  +                                    + primaryKey.getQualifiedClassName() + "couldn't be
"
  +                                    + "found on the classpath");
  +                    return -1;
  +                }
  +                latestModified = Math.max(latestModified, modified);
  +            }
  +            else {
  +                pkFile = null;
  +            }
  +
               /* Check the timestamp on the EJB implementation class.
                *
                * Note that if ONLY the implementation class has changed, it's not
  @@ -1211,6 +1243,12 @@
               pathToFile = pathToFile.replace('.', File.separatorChar) + ".class";
               ejbFiles.put(pathToFile, implFile);
   
  +            if (pkFile != null) {
  +                pathToFile = primaryKey.getQualifiedClassName();
  +                pathToFile = pathToFile.replace('.', File.separatorChar) + ".class";
  +                ejbFiles.put(pathToFile, pkFile);
  +            }
  +
               return latestModified;
           }
   
  @@ -1323,6 +1361,7 @@
                           + "\n\r              home:      " + home
                           + "\n\r              remote:    " + remote
                           + "\n\r              impl:      " + implementation
  +                        + "\n\r              primaryKey: " + primaryKey
                           + "\n\r              beantype:  " + beantype
                           + "\n\r              cmp:       " + cmp
                           + "\n\r              iiop:      " + iiop
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message