Update of /var/cvs/applications/crontab/src/org/mmbase/applications/crontab
In directory
james.mmbase.org:/tmp/cvs-serv15399/src/org/mmbase/applications/crontab
Modified Files:
CronEntry.java
Log Message:
implemented 'isActive'. This means all jobs are always in the daemon, but only
when running it is decied whter that is needed
See also:
http://cvs.mmbase.org/viewcvs/applications/crontab/src/org/mmbase/applications/crontab
Index: CronEntry.java
===================================================================
RCS file:
/var/cvs/applications/crontab/src/org/mmbase/applications/crontab/CronEntry.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -b -r1.18 -r1.19
--- CronEntry.java 4 Aug 2008 13:36:28 -0000 1.18
+++ CronEntry.java 2 Dec 2008 09:10:36 -0000 1.19
@@ -20,7 +20,7 @@
*
* @author Kees Jongenburger
* @author Michiel Meeuwissen
- * @version $Id: CronEntry.java,v 1.18 2008/08/04 13:36:28 michiel Exp $
+ * @version $Id: CronEntry.java,v 1.19 2008/12/02 09:10:36 michiel Exp $
*/
public class CronEntry implements java.io.Serializable {
@@ -202,6 +202,12 @@
public boolean isAlive() {
return isAlive(0);
}
+
+ public boolean isActive() {
+ String machineName = MMBaseContext.getMachineName();
+ return servers.matcher(machineName).matches();
+ }
+
public boolean isMustBeOne() {
return type == Type.MUSTBEONE || type == Type.BALANCE_MUSTBEONE;
}
@@ -325,11 +331,13 @@
return maxDuration;
}
+
+
boolean mustRun(Date date) {
String machineName = MMBaseContext.getMachineName();
- if (! servers.matcher(machineName).matches()) {
- log.debug("This cron entry " + this + " must not run because this
machine " + machineName + " does not match " + servers);
+ if (! isActive()) {
+ log.debug("This cron entry " + this + " must not run because it is
not active on this machine " + machineName);
return false;
} else {
log.debug(" " + machineName + " matched " + servers + " so must
run");
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs