private String getLocatorAsString(Locator l) { String lHost = l.isServerLocator() ? ((InternalLocator) l) .getServerLocatorAdvisee().getHostName() : l.getBindAddress() .getHostAddress(); StringBuilder locatorString = new StringBuilder(lHost); locatorString.append('[').append(l.getPort()).append(']'); return locatorString.toString(); }
public Profile getProfile() { return getDistributionAdvisor().createProfile(); }
/** * @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(); }
/** * @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; } }
public Object processRequest(Object request) throws IOException { if (!readyToProcessRequests()) { return null; response = getLocatorListResponse((LocatorListRequest) request); response = pickReplacementServer((ClientReplacementRequest) request); response = pickAllServers((GetAllServersRequest) request); response = pickServer((ClientConnectionRequest) request); response = pickQueueServers((QueueConnectionRequest) request);
if (serverLoc != null) { addMemberServer(member, serverLoc.getHostName() + '[' + serverLoc.getPort() + ']', this.locatorMap, false);
.getServerLocatorAdvisee(); if (serverLoc != null) { final ServerLocation server = serverLoc.getLoadSnapshot() .getServerForGroups(serverGroups, intersectGroups, excludedServerSet);
/** * @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 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 void logServers() { if (productUseLog != null) { StringBuilder sb = new StringBuilder(1000); Map<ServerLocation, ServerLoad> loadMap = getLoadMap(); if (loadMap.size() == 0) { return;
boolean durableQueueFound = false; if(clientRequest.isFindDurable() && clientRequest.getProxyId().isDurable()) { servers = FindDurableQueueProcessor.sendAndFind(this, clientRequest.getProxyId(), getDistributionManager());
ServerLocator sl = new ServerLocator(this.port, this.bindAddress, this.hostnameForClients,
private InternalDistributedSystem ds; private ControllerAdvisor advisor; private final int serialNumber = createSerialNumber(); private final LocatorStats stats; private LocatorLoadSnapshot loadSnapshot = new LocatorLoadSnapshot();
public Object processRequest(Object request) throws IOException { if (!readyToProcessRequests()) { return null; if(getLogWriterI18n().fineEnabled()) { getLogWriterI18n().fine("ServerLocator: Received request " + request); response = getLocatorListResponse((LocatorListRequest) request); response = pickReplacementServer((ClientReplacementRequest) request); response = pickAllServers((GetAllServersRequest) request); response = pickServer((ClientConnectionRequest) request); response = pickQueueServers((QueueConnectionRequest) request); if(getLogWriterI18n().fineEnabled()) { getLogWriterI18n().fine("ServerLocator: Sending response " + response);
if (serverLoc != null) { addMemberServer(member, serverLoc.getHostName() + '[' + serverLoc.getPort() + ']', this.locatorMap, false);
.getServerLocatorAdvisee(); if (serverLoc != null) { final ServerLocation server = serverLoc.getLoadSnapshot() .getServerForGroups(serverGroups, intersectGroups, excludedServerSet);
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 void logServers() { if (productUseLog != null) { StringBuilder sb = new StringBuilder(1000); Map<ServerLocation, ServerLoad> loadMap = getLoadMap(); if (loadMap.size() == 0) { return;
boolean durableQueueFound = false; if(clientRequest.isFindDurable() && clientRequest.getProxyId().isDurable()) { servers = FindDurableQueueProcessor.sendAndFind(this, clientRequest.getProxyId(), getDistributionManager());
ServerLocator sl = new ServerLocator(this.port, this.bindAddress, this.hostnameForClients,