private void doSetPeriod(long period) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, this + ": setPeriod(" + period + ")." + " -> task " + cleaningTask);
if (cleaningTask == null) {
cleaningTask = new WakeUpTask(getId(), WakeUpNot.class, period);
} else {
// cancel task
cleaningTask.cancel();
// Schedules the wake up task period.
if (period > 0)
cleaningTask = new WakeUpTask(getId(), WakeUpNot.class, period);
}
}