getPropertiesFromCommunityAttributes();
getPropertiesFromCommunityAttributes(); } else { log.error("Agent \"" + myAgent.toString() + "\" not identified as a \"CommunityManager\" in any active community!."); log.error("Check that the community to monitor has this agent identified\n"); log.error("in its \"CommunityManager\" attribute and that this agent is\n"); log.error("also identified as an Entity within the monitored community with\n"); log.error("the attribute \"Role=ManagementAgent\"."); }
  protected void setupSubscriptions() {    // Setup logger    log =  (LoggingService) getBindingSite().getServiceBroker().      getService(this, LoggingService.class, null);    bbs = getBlackboardService();    DomainService domainService =      (DomainService) getBindingSite().getServiceBroker().      getService(this, DomainService.class, null);    sensorFactory =      ((SensorFactory) domainService.getFactory("sensors"));    if (sensorFactory == null) {      log.error("Unable to get 'sensors' domain");    }    myAgent = getClusterIdentifier();    communityService = getCommunityService();    topologyService = getTopologyReaderService();    // Find name of community to monitor    Collection communities = communityService.search("(CommunityManager=" +      myAgent.toString() + ")");    if (!communities.isEmpty())      communityToMonitor = (String)communities.iterator().next();    // Initialize configurable paramaeters from defaults and plugin arguments.    getPropertiesFromCommunityAttributes();    updateParams(healthMonitorProps);    bbs.publishAdd(healthMonitorProps);    // Subscribe to CommunityRequests to get roster (and roster updates)    // from CommunityPlugin    communityRequests =      (IncrementalSubscription)bbs.subscribe(communityRequestPredicate);    // Subscribe to HeartbeatRequests to determine if HeartbeatRequest was    // received/accepted by monitored agent    heartbeatRequests =      (IncrementalSubscription)bbs.subscribe(heartbeatRequestPredicate);    // Subscribe to PingRequests to receive ping results    pingRequests =      (IncrementalSubscription)bbs.subscribe(pingRequestPredicate);    // Subscribe to HeartbeatHealthReports to receive notification of failed    // heartbeats    heartbeatHealthReports =      (IncrementalSubscription)bbs.subscribe(heartbeatPredicate);    // Subscribe to ManagementAgentProperties to get changes to configurable    // parameters.    mgmtAgentProps =      (IncrementalSubscription)bbs.subscribe(propertiesPredicate);    // Get Roster for community to monitor    if (communityToMonitor != null && communityToMonitor.length() > 0) {      sendRosterRequest(communityToMonitor);      //communityService.addListener(this);      //processRosterChanges(communityService.getRoster(communityToMonitor));    }    // Start evaluation thread to periodically update and analyze the Health    // Status of monitored agents    startEvaluationThread(evaluationFrequency);    // Print informational message defining current parameters    StringBuffer startMsg = new StringBuffer();    startMsg.append("agent=" + myAgent);    startMsg.append(" community=" + communityToMonitor);    startMsg.append(" " + paramsToString());    log.info(startMsg.toString());  }