perfsonar-dev - perfsonar: r5073 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler
Subject: perfsonar development work
List archive
perfsonar: r5073 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler
Chronological Thread
- From:
- To:
- Subject: perfsonar: r5073 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler
- Date: Fri, 13 Mar 2009 11:27:28 -0400
Author: mac
Date: 2009-03-13 11:27:27 -0400 (Fri, 13 Mar 2009)
New Revision: 5073
Modified:
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
Log:
Adding option status=on/off to scheduler action
Modified:
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
===================================================================
---
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
2009-03-13 15:05:16 UTC (rev 5072)
+++
branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler/SchedulingComponent.java
2009-03-13 15:27:27 UTC (rev 5073)
@@ -137,26 +137,36 @@
for (Action action : actions) {
+ // get option "interval" from action and try to convert it to
+ // int
int actionInterval = this.interval;
try {
- // get option interval from action and try to convert it
to
- // int
-
actionInterval = Integer.parseInt(action.getOption(
"interval").getValue());
-
} catch (Exception ex) {
- //NullPointer if no option
- //or
- //NumberFormatException
+ //NullPointer if no option or NumberFormatException
logger.warn("Taking default ["+actionInterval+"] value
of action interval");
}
- scheduler.addTask(actionInterval, (SchedulerAction) action);
+
+ // get option status - on/off
+ String actionStatus = "on";
+ try {
+ actionStatus = action.getOption("status").getValue();
+ } catch (Exception ex) { }
+
+ if ("on".equals(actionStatus)) {
+ scheduler.addTask(actionInterval, (SchedulerAction)
action);
+ logger.debug("Action [" + action.getName() + "] class ["
+ + action.getClass()
+ + "] registered to the scheduler with interval ["
+ + actionInterval + "] seconds");
+ } else
+ logger.info("Action [" + action.getName() + "] class ["
+ + action.getClass()
+ + "] not loaded, status set to [OFF]");
- logger.debug("Action [" + action.getName() + "] class ["
- + action.getClass()
- + "] registered to the scheduler with interval ["
- + actionInterval + "] seconds");
+
+
}
}
- perfsonar: r5073 - branches/new-structure-with-base2/ps-mdm-base2/src/main/java/org/perfsonar/base2/service/scheduler, svnlog, 03/13/2009
Archive powered by MHonArc 2.6.16.