static public long getStartTime(SystemAdvertisement adv) { long result = 0L; try { result = Long.parseLong(adv.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} return result; }
public static String getGroupName(SystemAdvertisement advert) { try { return advert.getCustomTagValue(CustomTagNames.GROUP_NAME.toString()); } catch (NoSuchFieldException nsfe) { if (logger.isLoggable(Level.FINER)) { logger.finer( "NoSuchFieldException caught in Utility#getGroupName. Returning null"); } return null; } } }
static public long getStartTime(SystemAdvertisement adv) { long result = 0L; try { result = Long.parseLong(adv.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} return result; }
public static String getGroupName(SystemAdvertisement advert) { try { return advert.getCustomTagValue(CustomTagNames.GROUP_NAME.toString()); } catch (NoSuchFieldException nsfe) { if (logger.isLoggable(Level.FINER)) { logger.finer( "NoSuchFieldException caught in Utility#getGroupName. Returning null"); } return null; } } }
public static long getStartTime(SystemAdvertisement advert) { try { return Long.valueOf(advert.getCustomTagValue( CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException nsfe) { // logged at FINER since most calling methods already // log result at FINE or higher if (logger.isLoggable(Level.FINER)) { logger.finer(String.format( "NoSuchFieldException caught in Utility#getStartTime. Returning %s", NO_SUCH_TIME)); } return NO_SUCH_TIME; } }
public static long getStartTime(SystemAdvertisement advert) { try { return Long.valueOf(advert.getCustomTagValue( CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException nsfe) { // logged at FINER since most calling methods already // log result at FINE or higher if (logger.isLoggable(Level.FINER)) { logger.finer(String.format( "NoSuchFieldException caught in Utility#getStartTime. Returning %s", NO_SUCH_TIME)); } return NO_SUCH_TIME; } }
@Override public void join() throws GMSException { viewWindowThread = isWatchdog() ? null : new Thread(viewWindow, "GMS ViewWindowThread Group-" + groupName); messageWindow = new MessageWindow(groupName, messageQueue); messageWindowThread = new Thread(messageWindow, "GMS MessageWindowThread Group-" + groupName); messageWindowThread.setDaemon(true); messageWindowThread.start(); if (viewWindowThread != null) { viewWindowThread.setDaemon(true); viewWindowThread.start(); } final Map<String, String> idMap = new HashMap<String, String>(); idMap.put(CustomTagNames.MEMBER_TYPE.toString(), memberType); idMap.put(CustomTagNames.GROUP_NAME.toString(), groupName); idMap.put(CustomTagNames.START_TIME.toString(), startTime.toString()); try { groupCommunicationProvider.initializeGroupCommunicationProvider( serverToken, groupName, idMap, configProperties); groupCommunicationProvider.join(); } catch (Throwable t) { // transport can throw IllegalStateException if not able to start up correctly. GMSException ge = new GMSException("failed to join group " + groupName, t); throw ge; } }
@Override public void join() throws GMSException { viewWindowThread = isWatchdog() ? null : new Thread(viewWindow, "GMS ViewWindowThread Group-" + groupName); messageWindow = new MessageWindow(groupName, messageQueue); messageWindowThread = new Thread(messageWindow, "GMS MessageWindowThread Group-" + groupName); messageWindowThread.setDaemon(true); messageWindowThread.start(); if (viewWindowThread != null) { viewWindowThread.setDaemon(true); viewWindowThread.start(); } final Map<String, String> idMap = new HashMap<String, String>(); idMap.put(CustomTagNames.MEMBER_TYPE.toString(), memberType); idMap.put(CustomTagNames.GROUP_NAME.toString(), groupName); idMap.put(CustomTagNames.START_TIME.toString(), startTime.toString()); try { groupCommunicationProvider.initializeGroupCommunicationProvider( serverToken, groupName, idMap, configProperties); groupCommunicationProvider.join(); } catch (Throwable t) { // transport can throw IllegalStateException if not able to start up correctly. GMSException ge = new GMSException("failed to join group " + groupName, t); throw ge; } }
if (key.equals(CustomTagNames.START_TIME.toString())) { sb.append("["); sb.append(MessageFormat.format("{0,time,full} on {0,date}", new Date(Long.parseLong(entry.getValue()))));
if (key.equals(CustomTagNames.START_TIME.toString())) { sb.append("["); sb.append(MessageFormat.format("{0,time,full} on {0,date}", new Date(Long.parseLong(entry.getValue()))));
seniorMember = i; try { seniorMemberStartTime = Long.parseLong(i.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} } else { long iCurrentStartTime = Long.MAX_VALUE; try { iCurrentStartTime = Long.parseLong(i.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} if (iCurrentStartTime < seniorMemberStartTime ){
seniorMember = i; try { seniorMemberStartTime = Long.parseLong(i.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} } else { long iCurrentStartTime = Long.MAX_VALUE; try { iCurrentStartTime = Long.parseLong(i.getCustomTagValue(CustomTagNames.START_TIME.toString())); } catch (NoSuchFieldException ignore) {} if (iCurrentStartTime < seniorMemberStartTime ){
public static GMSMember getGMSMember( final SystemAdvertisement systemAdvertisement ) { GMSMember member; String memberType = getCustomTagValue(systemAdvertisement, CustomTagNames.MEMBER_TYPE.toString()); String groupName = getGroupName(systemAdvertisement); long startTime = getStartTime(systemAdvertisement); member = new GMSMember( systemAdvertisement.getName(), memberType, groupName, startTime); return member; }
public static GMSMember getGMSMember( final SystemAdvertisement systemAdvertisement ) { GMSMember member; String memberType = getCustomTagValue(systemAdvertisement, CustomTagNames.MEMBER_TYPE.toString()); String groupName = getGroupName(systemAdvertisement); long startTime = getStartTime(systemAdvertisement); member = new GMSMember( systemAdvertisement.getName(), memberType, groupName, startTime); return member; }
final List<ClusterViewEventListener> viewListeners, final List<ClusterMessageListener> messageListeners) throws GMSException { this.memberType = (String)identityMap.get( CustomTagNames.MEMBER_TYPE.toString()); this.groupName = groupName; this.instanceName = instanceName;
final List<ClusterViewEventListener> viewListeners, final List<ClusterMessageListener> messageListeners) throws GMSException { this.memberType = (String)identityMap.get( CustomTagNames.MEMBER_TYPE.toString()); this.groupName = groupName; this.instanceName = instanceName;