/** Execute an automated action. */ public void execute(final AlarmHandler alarmHandler) { new ExecuteActionThread( alarmHandler.getScheduledAction(), alarmHandler.getInfos(), alarmHandler.getCurrentSnapshots()) .start(); if (debug) AlarmNotifierHistory.getInstance().addAction(alarmHandler); }
@Override public void run() { if (alarmHandler.getStatus().equals(EActionStatus.PENDING) || alarmHandler.getStatus().equals(EActionStatus.FORCED)) { if (alarmHandler.getStatus().equals(EActionStatus.PENDING)) alarmHandler.setStatus(EActionStatus.EXECUTED); execute(alarmHandler); } else { if (debug) AlarmNotifierHistory.getInstance().addAction(alarmHandler); Activator.getLogger() .log( Level.INFO, "CANCEL " + alarmHandler.getInfos() + " because " + alarmHandler.getReason()); } remove(this.alarmHandler); }