コード例 #1
0
  private AgentInstance[] getAgentInstancesForStmt(
      String statementId, ContextPartitionSelector selector) {
    Collection<Integer> agentInstanceIds = getAgentInstanceIds(selector);
    if (agentInstanceIds == null || agentInstanceIds.isEmpty()) {
      return new AgentInstance[0];
    }

    List<AgentInstance> instances = new ArrayList<AgentInstance>(agentInstanceIds.size());
    for (Integer agentInstanceId : agentInstanceIds) {
      ContextControllerTreeAgentInstanceList instancesList = agentInstances.get(agentInstanceId);
      if (instancesList != null) {
        Iterator<AgentInstance> instanceIt = instancesList.getAgentInstances().iterator();
        for (; instanceIt.hasNext(); ) {
          AgentInstance instance = instanceIt.next();
          if (instance
              .getAgentInstanceContext()
              .getStatementContext()
              .getStatementId()
              .equals(statementId)) {
            instances.add(instance);
          }
        }
      }
    }
    return instances.toArray(new AgentInstance[instances.size()]);
  }
コード例 #2
0
 public void deactivateContextPartitions(Set<Integer> agentInstanceIds) {
   for (Integer agentInstanceId : agentInstanceIds) {
     ContextControllerTreeAgentInstanceList list = agentInstances.get(agentInstanceId);
     StatementAgentInstanceUtil.stopAgentInstances(
         list.getAgentInstances(), null, servicesContext, false);
   }
 }
コード例 #3
0
 public synchronized void contextPartitionTerminate(
     ContextControllerInstanceHandle contextNestedHandle,
     Map<String, Object> terminationProperties) {
   ContextNestedHandleImpl handle = (ContextNestedHandleImpl) contextNestedHandle;
   ContextControllerTreeAgentInstanceList entry =
       agentInstances.remove(handle.getContextPartitionOrPathId());
   if (entry != null) {
     StatementAgentInstanceUtil.stopAgentInstances(
         entry.getAgentInstances(), terminationProperties, servicesContext, false);
     entry.getAgentInstances().clear();
     contextPartitionIdManager.removeId(contextNestedHandle.getContextPartitionOrPathId());
   }
 }