Iterator iter = rr.getOriginalActions().iterator(); while (iter.hasNext()) { DisconnectAction action = (DisconnectAction)iter.next(); try { action.start(request); action.stop(Action.FAILED); action.setValuesOffered(NULL_SET); blackboard.publishChange(action); } catch (IllegalValueException e) { logger.error("Attempt to start: "+action.dump()+" with illegal value "+e.toString()); return false; } catch (NoStartedActionException e) { logger.error("Attempt to stop: "+action.dump()+" with illegal value "+e.toString()); return false; } }
    private boolean denyPermissions(RequestRecord rr) {        cancelRequestedAlarm(rr);        DisconnectDefenseAgentEnabler enabler = DisconnectDefenseAgentEnabler.findOnBlackboard(rr.getNodeID().getType().toString(), rr.getNodeID().getName().toString(), blackboard);        String request = rr.getRequest();        AssetID nodeID = rr.getNodeID();        // tell the Coord that all Actions have stopped FAILED        Iterator iter = rr.getOriginalActions().iterator();        while (iter.hasNext()) {            DisconnectAction action = (DisconnectAction)iter.next();            try {                action.start(request);                action.stop(Action.FAILED);                action.setValuesOffered(NULL_SET); // remove offers - this has the added effect that the action will be considered by the Coord to be irrecocable                blackboard.publishChange(action);            } catch (IllegalValueException e) {                logger.error("Attempt to start: "+action.dump()+" with illegal value "+e.toString());                return false;            } catch (NoStartedActionException e) {                logger.error("Attempt to stop: "+action.dump()+" with illegal value "+e.toString());                return false;            }        }        if (enabler != null) {            enabler.setValue(request.equals(ALLOW_DISCONNECT) ? "DISABLED" : "ENABLED");  // Tell the node it can NOT do what it requested            blackboard.publishChange(enabler);            // change the Diagnosis back to its value before the denied request            iter = rr.getOriginalDiagnoses().iterator();            while (iter.hasNext()) {                Diagnosis diag = (Diagnosis)iter.next();                try {                    diag.setValue(rr.getRequest().equals(ALLOW_DISCONNECT) ? CONNECTED : DISCONNECTED);                    blackboard.publishChange(diag);                } catch (IllegalValueException e) {                    logger.error("Attempt to set: "+diag.toString()+" with illegal value "+e.toString());                }            }            return true;        }        else {            logger.warn("could not find Enabler for" + rr.dump());            return false;        }     }