private void addPlannedShutdownSignals(final EventPacket packet) { final SystemAdvertisement advert = packet.getSystemAdvertisement(); final String token = advert.getName(); final DistributedStateCache dsc = getGMSContext().getDistributedStateCache(); final GMSConstants.shutdownType shutdownType; if (packet.getClusterViewEvent().equals(ClusterViewEvents.CLUSTER_STOP_EVENT)) { shutdownType = GMSConstants.shutdownType.GROUP_SHUTDOWN; } else { shutdownType = GMSConstants.shutdownType.INSTANCE_SHUTDOWN; if (dsc != null) { dsc.removeAllForMember(token); } } logger.log(Level.INFO, "plannedshutdownevent.announcement", new Object[]{token, shutdownType, groupName}); String gName = Utility.getGroupName(advert); if (gName == null) { logger.log(Level.WARNING, "systemadv.not.contain.customtag", CustomTagNames.GROUP_NAME); return; } long startTime = Utility.getStartTime(advert); if (startTime == Utility.NO_SUCH_TIME) { logger.log(Level.WARNING, "systemadv.not.contain.customtag", CustomTagNames.START_TIME); return; } signals.add(new PlannedShutdownSignalImpl(token, gName, startTime, shutdownType)); }
private void addPlannedShutdownSignals(final EventPacket packet) { final SystemAdvertisement advert = packet.getSystemAdvertisement(); final String token = advert.getName(); final DistributedStateCache dsc = getGMSContext().getDistributedStateCache(); final GMSConstants.shutdownType shutdownType; if (packet.getClusterViewEvent().equals(ClusterViewEvents.CLUSTER_STOP_EVENT)) { shutdownType = GMSConstants.shutdownType.GROUP_SHUTDOWN; } else { shutdownType = GMSConstants.shutdownType.INSTANCE_SHUTDOWN; if (dsc != null) { dsc.removeAllForMember(token); } } logger.log(Level.INFO, "plannedshutdownevent.announcement", new Object[]{token, shutdownType, groupName}); String gName = Utility.getGroupName(advert); if (gName == null) { logger.log(Level.WARNING, "systemadv.not.contain.customtag", CustomTagNames.GROUP_NAME); return; } long startTime = Utility.getStartTime(advert); if (startTime == Utility.NO_SUCH_TIME) { logger.log(Level.WARNING, "systemadv.not.contain.customtag", CustomTagNames.START_TIME); return; } signals.add(new PlannedShutdownSignalImpl(token, gName, startTime, shutdownType)); }