Esempio n. 1
0
  private void removeStatement(String statementId) {
    ContextControllerStatementDesc statementDesc = statements.get(statementId);
    if (statementDesc == null) {
      return;
    }

    for (Map.Entry<Integer, ContextControllerTreeAgentInstanceList> contextPartitionEntry :
        agentInstances.entrySet()) {
      Iterator<AgentInstance> instanceIt =
          contextPartitionEntry.getValue().getAgentInstances().iterator();
      for (; instanceIt.hasNext(); ) {
        AgentInstance instance = instanceIt.next();
        if (!instance
            .getAgentInstanceContext()
            .getStatementContext()
            .getStatementId()
            .equals(statementId)) {
          continue;
        }
        StatementAgentInstanceUtil.stop(
            instance.getStopCallback(),
            instance.getAgentInstanceContext(),
            instance.getFinalView(),
            servicesContext,
            true);
        instanceIt.remove();
      }
    }

    statements.remove(statementId);
  }