Пример #1
0
    private void callDisconnectionOperation(ClientEndpointImpl endpoint) {
      Collection<Member> memberList = nodeEngine.getClusterService().getMembers();
      OperationService operationService = nodeEngine.getOperationService();
      ClientDisconnectionOperation op = createClientDisconnectionOperation(endpoint.getUuid());
      operationService.runOperationOnCallingThread(op);

      for (Member member : memberList) {
        if (!member.localMember()) {
          op = createClientDisconnectionOperation(endpoint.getUuid());
          operationService.send(op, member.getAddress());
        }
      }
    }
Пример #2
0
  protected void startClusterMerge(final Address targetAddress) {
    ClusterServiceImpl clusterService = node.clusterService;

    if (!prepareClusterState(clusterService)) {
      return;
    }

    OperationService operationService = node.nodeEngine.getOperationService();
    Collection<Member> memberList = clusterService.getMembers();
    for (Member member : memberList) {
      if (!member.localMember()) {
        Operation op = new MergeClustersOperation(targetAddress);
        operationService.invokeOnTarget(ClusterServiceImpl.SERVICE_NAME, op, member.getAddress());
      }
    }

    Operation mergeClustersOperation = new MergeClustersOperation(targetAddress);
    mergeClustersOperation
        .setNodeEngine(node.nodeEngine)
        .setService(clusterService)
        .setOperationResponseHandler(createEmptyResponseHandler());
    operationService.runOperationOnCallingThread(mergeClustersOperation);
  }