@Override public void complete() { initialized.compareAndSet(true, false); initializationComplete.compareAndSet(true, false); gms = null; GMSFactory.removeGMSModule(clusterName); }
/** * Called when the application layer is shutting down and this member needs to leave * the group formally for a graceful shutdown event. * * @param shutdownType shutdown type corresponds to the shutdown types specified * in GMSConstants.shudownType enum. */ private void leave(final GMSConstants.shutdownType shutdownType) { // ensure that only leave the group once. if (hasLeftGroup.compareAndSet(false, true)) { try { logger.log(Level.INFO, "gms.leave", new Object[]{memberName, ctx.getGroupName()}); ctx.leave(shutdownType); removeAllActionFactories(); } finally { hasJoinedGroup.set(false); GMSFactory.removeGMSModule(ctx.getGroupName()); GMSContextFactory.removeGMSContext(ctx.getGroupName()); } } }
/** * Called when the application layer is shutting down and this member needs to leave * the group formally for a graceful shutdown event. * * @param shutdownType shutdown type corresponds to the shutdown types specified * in GMSConstants.shudownType enum. */ private void leave(final GMSConstants.shutdownType shutdownType) { // ensure that only leave the group once. if (hasLeftGroup.compareAndSet(false, true)) { try { logger.log(Level.INFO, "gms.leave", new Object[]{memberName, ctx.getGroupName()}); ctx.leave(shutdownType); removeAllActionFactories(); } finally { hasJoinedGroup.set(false); GMSFactory.removeGMSModule(ctx.getGroupName()); GMSContextFactory.removeGMSContext(ctx.getGroupName()); } } }