@@ -878,6 +878,8 @@ public class IPlanetEjbc {
currentEjb.setRemote(value);
currentEjb.setRemote(value);
} else if (currentLoc.equals(base + "\\ejb-class")) {
} else if (currentLoc.equals(base + "\\ejb-class")) {
currentEjb.setImplementation(value);
currentEjb.setImplementation(value);
} else if (currentLoc.equals(base + "\\prim-key-class")) {
currentEjb.setPrimaryKey(value);
} else if (currentLoc.equals(base + "\\session-type")) {
} else if (currentLoc.equals(base + "\\session-type")) {
currentEjb.setBeantype(value);
currentEjb.setBeantype(value);
} else if (currentLoc.equals(base + "\\persistence-type")) {
} else if (currentLoc.equals(base + "\\persistence-type")) {
@@ -927,6 +929,7 @@ public class IPlanetEjbc {
private Classname home; // EJB's home interface name
private Classname home; // EJB's home interface name
private Classname remote; // EJB's remote interface name
private Classname remote; // EJB's remote interface name
private Classname implementation; // EJB's implementation class
private Classname implementation; // EJB's implementation class
private Classname primaryKey; // EJB's primary key class
private String beantype = "entity"; // or "stateful" or "stateless"
private String beantype = "entity"; // or "stateful" or "stateless"
private boolean cmp = false; // Does this EJB support CMP?
private boolean cmp = false; // Does this EJB support CMP?
private boolean iiop = false; // Does this EJB support IIOP?
private boolean iiop = false; // Does this EJB support IIOP?
@@ -1004,6 +1007,18 @@ public class IPlanetEjbc {
return implementation;
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) {
public void setBeantype(String beantype) {
this.beantype = beantype.toLowerCase();
this.beantype = beantype.toLowerCase();
}
}
@@ -1158,6 +1173,7 @@ public class IPlanetEjbc {
File remoteFile; // File for the remote interface class
File remoteFile; // File for the remote interface class
File homeFile; // File for the home interface class
File homeFile; // File for the home interface class
File implFile; // File for the EJB implementation 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 */
/* Check the timestamp on the remote interface */
remoteFile = remote.getClassFile(buildDir);
remoteFile = remote.getClassFile(buildDir);
@@ -1181,6 +1197,22 @@ public class IPlanetEjbc {
}
}
latestModified = Math.max(latestModified, modified);
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.
/* Check the timestamp on the EJB implementation class.
*
*
* Note that if ONLY the implementation class has changed, it's not
* Note that if ONLY the implementation class has changed, it's not
@@ -1211,6 +1243,12 @@ public class IPlanetEjbc {
pathToFile = pathToFile.replace('.', File.separatorChar) + ".class";
pathToFile = pathToFile.replace('.', File.separatorChar) + ".class";
ejbFiles.put(pathToFile, implFile);
ejbFiles.put(pathToFile, implFile);
if (pkFile != null) {
pathToFile = primaryKey.getQualifiedClassName();
pathToFile = pathToFile.replace('.', File.separatorChar) + ".class";
ejbFiles.put(pathToFile, pkFile);
}
return latestModified;
return latestModified;
}
}
@@ -1323,6 +1361,7 @@ public class IPlanetEjbc {
+ "\n\r home: " + home
+ "\n\r home: " + home
+ "\n\r remote: " + remote
+ "\n\r remote: " + remote
+ "\n\r impl: " + implementation
+ "\n\r impl: " + implementation
+ "\n\r primaryKey: " + primaryKey
+ "\n\r beantype: " + beantype
+ "\n\r beantype: " + beantype
+ "\n\r cmp: " + cmp
+ "\n\r cmp: " + cmp
+ "\n\r iiop: " + iiop
+ "\n\r iiop: " + iiop