commSvc.removeListener(listener); listener = null;
if (listener != null) { commSvc.removeListener(listener); listener = null; }
    public synchronized void execute() {	Iterator iter;	if (log.isDebugEnabled()) {	    iter = sub.getAddedCollection().iterator();	    while (iter.hasNext()) {		RobustnessManagerID mgr = (RobustnessManagerID)iter.next();		if (mgr != null)		    log.debug(agentId+": "+mgr+" added.");	    }	    iter = sub.getChangedCollection().iterator();	    while (iter.hasNext()) {		RobustnessManagerID mgr = (RobustnessManagerID)iter.next();		if (mgr != null)		    log.debug(agentId+": "+mgr+" changed.");	    }	}		if (community != null) {	    Attributes attrs = community.getAttributes();            if (log.isDebugEnabled())		log.debug(agentId+			  ": execute: community attributes = " 			  +attrs);            Attribute mgrs = attrs.get("RobustnessManager");            if (mgrs == null) {		if (log.isErrorEnabled()) {		    log.error(agentId+			      ": execute: no RobustnessManager attribute found in community = "			      +community);		    community = null;		}	    } else {		try {		    NamingEnumeration enum = mgrs.getAll();		    while (enum.hasMore()) {			Object obj = enum.next();			if (obj == null) {			    if (log.isErrorEnabled()) 				log.error(agentId+					  ": execute: null value in Attribute  " 					  +mgrs);			} else if (!(obj instanceof String)) {			    if (log.isErrorEnabled()) 				log.error(agentId+					  ": execute: non-String value="+obj+" found in Attribute "					  +mgrs);				} else if (mgr == null) {			    String mgrAgentName = (String)obj;			    MessageAddress mgrAgentAddr = MessageAddress.getMessageAddress(mgrAgentName);			    mgr = new RobustnessManagerID(mgrAgentAddr,uidSvc.nextUID());			    if (log.isDebugEnabled()) 				log.debug(agentId+					  ": execute: RobustnessManager "+mgrAgentName+" found.");			    bb.publishAdd(mgr);			    commSvc.removeListener(listener);			    listener = null;			} else {			    if (log.isDebugEnabled()) 				log.debug(agentId+					  ": execute: RobustnessManager already found.  Additional value="					  +obj+" found and discarded.");			}		    }		} catch (NamingException e) {			    if (log.isErrorEnabled()) 				log.error(agentId+					  ": execute: NamingException thrown while enumerating RobustnessManager Attribute = "					  + mgrs, e);		}	    }				