Пример #1
0
 public void memberRemoved(MembershipServiceEvent event) {
   if (event.getMember().localMember()) {
     return;
   }
   final String uuid = event.getMember().getUuid();
   try {
     nodeEngine
         .getExecutionService()
         .schedule(
             new Runnable() {
               public void run() {
                 final Iterator<ClientEndpoint> iter = endpoints.values().iterator();
                 while (iter.hasNext()) {
                   final ClientEndpoint endpoint = iter.next();
                   if (uuid.equals(endpoint.getPrincipal().getOwnerUuid())) {
                     iter.remove();
                     destroyEndpoint(endpoint, true);
                   }
                 }
               }
             },
             10,
             TimeUnit.SECONDS);
   } catch (RejectedExecutionException e) {
     // means node is shutting down...
   }
 }
Пример #2
0
  @Override
  public void memberRemoved(MembershipServiceEvent event) {
    if (event.getMember().localMember()) {
      return;
    }

    final String deadMemberUuid = event.getMember().getUuid();
    try {
      nodeEngine
          .getExecutionService()
          .schedule(
              new DestroyEndpointTask(deadMemberUuid),
              ENDPOINT_REMOVE_DELAY_SECONDS,
              TimeUnit.SECONDS);

    } catch (RejectedExecutionException e) {
      if (logger.isFinestEnabled()) {
        logger.finest(e);
      }
    }
  }