/** * @param profile */ public void profileRemoved(Profile profile) { if(profile instanceof CacheServerProfile) { CacheServerProfile bp = (CacheServerProfile) profile; //InternalDistributedMember id = bp.getDistributedMember(); ServerLocation location = buildServerLocation(bp); loadSnapshot.removeServer(location); if(logger.isDebugEnabled()) { logger.debug("ServerLocator: server departed {}", location); } synchronized(ownerMap) { ownerMap.remove(location); } } else { cachedLocators = null; } }
private ArrayList getLocators() { if(cachedLocators != null) { return cachedLocators; } else { synchronized(cachedLocatorsLock) { List profiles = advisor.fetchControllers(); ArrayList result = new ArrayList(profiles.size() + 1); for (Iterator itr = profiles.iterator(); itr.hasNext(); ) { result.add(buildServerLocation((ControllerProfile) itr.next())); } result.add(new ServerLocation(hostNameForClients,port)); cachedLocators = result; return result; } } }
private ArrayList getLocators() { if(cachedLocators != null) { return cachedLocators; } else { synchronized(cachedLocatorsLock) { List profiles = advisor.fetchControllers(); ArrayList result = new ArrayList(profiles.size() + 1); for (Iterator itr = profiles.iterator(); itr.hasNext(); ) { result.add(buildServerLocation((ControllerProfile) itr.next())); } result.add(new ServerLocation(hostNameForClients,port)); cachedLocators = result; return result; } } }
/** * @param profile */ public void profileRemoved(Profile profile) { if(profile instanceof BridgeServerProfile) { BridgeServerProfile bp = (BridgeServerProfile) profile; //InternalDistributedMember id = bp.getDistributedMember(); ServerLocation location = buildServerLocation(bp); loadSnapshot.removeServer(location); if(getLogWriterI18n().fineEnabled()) { getLogWriterI18n().fine("ServerLocator: server departed " + location); } synchronized(ownerMap) { ownerMap.remove(location); } } else { cachedLocators = null; } }
/** * @param profile */ public void profileCreated(Profile profile) { if(profile instanceof CacheServerProfile) { CacheServerProfile bp = (CacheServerProfile) profile; ServerLocation location = buildServerLocation(bp); String[] groups = bp.getGroups(); loadSnapshot.addServer(location, groups, bp.getInitialLoad(), bp.getLoadPollInterval()); if(logger.isDebugEnabled()) { logger.debug("ServerLocator: Received load from a new server {}, {}", location, bp.getInitialLoad()); } synchronized(ownerMap) { ownerMap.put(location, profile.getDistributedMember()); } } else { cachedLocators = null; } logServers(); }
/** * @param profile */ public void profileCreated(Profile profile) { if(profile instanceof BridgeServerProfile) { BridgeServerProfile bp = (BridgeServerProfile) profile; ServerLocation location = buildServerLocation(bp); String[] groups = bp.getGroups(); loadSnapshot.addServer(location, groups, bp.getInitialLoad(), bp.getLoadPollInterval()); if(getLogWriterI18n().fineEnabled()) { getLogWriterI18n().fine("ServerLocator: Received load from a new server " + location + ", " + bp.getInitialLoad()); } synchronized(ownerMap) { ownerMap.put(location, profile.getDistributedMember()); } } else { cachedLocators = null; } logServers(); }