logger.debug("============= Saw new Action (with UID="+a.getUID()+")-- Wrapping it.");
logger.debug("============= On asset ["+this.agentId+"] Saw new Action (with UID="+a.getUID()+")-- Wrapping it & relaying to "+managerAddress);
    protected void execute() {        boolean mgrJustFound = false;        Iterator iter;        //First check to see if we know where the manager is. If not, look it up (if shouldRelayActions == true).        if (managerAddress == null && shouldRelayActions) {            //Check to see if the Coordinator's address is known...            iter = managerAddressSubscription.getAddedCollection().iterator();            if (iter.hasNext()) {              // find & set the ManagerAgent address               managerAddress = ((RobustnessManagerID)iter.next()).getMessageAddress();               mgrJustFound = true; //signal that there might be unwrapped actions that need to be wrapped                                    // -- They weren't wrapped because the mgr wasn't found.               if (logger.isDebugEnabled()) logger.debug("++++++++++++++++++++++++++++> ManagerAddress: "+managerAddress.toString());                              //Update the knob with status -- we know where the coordinator is               iter = knobSubscription.getCollection().iterator();                       if (iter.hasNext()) {                   ActionRelayManagerKnob = (ActionRelayManagerKnob)iter.next();                   ActionRelayManagerKnob.setFoundCoordinator(managerAddress);               }                               } else {               if (logger.isDebugEnabled()) logger.debug("++++++++++++++++++++++++++++> ManagerAddress subscription empty.");            }                        }                if (managerAddress == null || !shouldRelayActions)             return; //we cannot forward Actions until we known where the coordinator is        //See if our knob has changed...        iter = knobSubscription.getChangedCollection().iterator();                if (iter.hasNext()) {            ActionRelayManagerKnob = (ActionRelayManagerKnob)iter.next();            shouldRelayActions = ActionRelayManagerKnob.getShouldRelay();        }                //Wrap & Relay the Actions -- won't get here if managerAddress == null        if (shouldRelayActions) {                        Collection added = null;                        if (mgrJustFound) { //then all of the actions should need to be wrapped.                added = actionsSubscription.getCollection();                            } else {           //Only need to get all added Actions & wrap them with a ActionsWrapper                added = actionsSubscription.getAddedCollection();            }            for ( iter = added.iterator(); iter.hasNext() ; )             {                Action a = (Action)iter.next();                                if (a.getWrapper() == null) { //Make sure it wasn't already wrapped... just a precaution                    logger.debug("============= Saw new Action (with UID="+a.getUID()+")-- Wrapping it.");                    UID uid = this.us.nextUID(); //gen UID for this wrapper                    ActionsWrapper aw = new ActionsWrapper(a, this.agentId, managerAddress, uid); //wrap the Action                    //registerUID(uid); //record all UIDs so we know what wrappers are out there.                    a.setWrapper(aw);                    this.publishAdd(aw);                                    newWrappers.add(aw);                }            }                        //Now look at changed Actions            Collection changed  = actionsSubscription.getChangedCollection();                    Collection wrappers = wrapperSubscription.getCollection();                    added.addAll(changed);            wrappers.addAll(newWrappers); //add newly created wrappers (that aren't yet on the BB) to the ones from the BB                        for ( iter = added.iterator(); iter.hasNext() ; )             {                Action a = (Action)iter.next();                                //Find wrapper for this Action                ActionsWrapper aw = findWrapper(a, wrappers);                //runFilters                if (aw != null && runFilters(aw)) {                    this.publishChange(aw);                }                            }            newWrappers.clear(); // clear this as these wrappers will now be committed to the BB                    }               }