/** * @since GemFire 5.7 */ private void doLocator(Attributes atts) { PoolFactory f = (PoolFactory) stack.peek(); String host = atts.getValue(HOST).trim(); int port = parseInt(atts.getValue(PORT)); f.addLocator(host, port); }
/** * Add a locator, given its host and port, to this factory. The locator must be a server locator * and will be used to discover other running cache servers and locators. Note that if the host is * unknown at the time of this call the locator will still be added. When the pool is used for an * operation if the host is still unknown an exception will be thrown. * * @param host the host name or ip address that the locator is listening on. * @param port the port that the locator is listening on * @return a reference to <code>this</code> * @throws IllegalArgumentException if port is outside the valid range of [0..65535] inclusive. * @throws IllegalStateException if a server has already been {@link #addPoolServer added} to this * factory. */ public ClientCacheFactory addPoolLocator(String host, int port) { getPoolFactory().addLocator(host, port); return this; }
pf.addLocator(host, DistributedTestUtils.getDUnitLocatorPort()); } else { for (int z = 0; z < ports.length; z++) {
List<InetSocketAddress> servers = new ArrayList<>(); when(mockPoolFactory.addLocator(anyString(), anyInt())).thenAnswer(invocation -> { locators.add(new InetSocketAddress(invocation.<String>getArgument(0), invocation.getArgument(1))); return mockPoolFactory;
mockPoolFactory.addLocator(invocation.getArgument(0), invocation.getArgument(1)); return clientCacheFactorySpy; }).when(clientCacheFactorySpy).addPoolLocator(anyString(), anyInt());
public static void main(String[] args) { // connect to the locator using default port 10334 ClientCache cache = new ClientCacheFactory().set("log-level", "WARN").create(); final String poolName = "subscriptionPool"; PoolManager.createFactory().addLocator("127.0.0.1", 10334).setSubscriptionEnabled(true) .create(poolName); // create a local region that matches the server region final ClientRegionFactory<Integer, String> incomingRegionFactory = cache.<Integer, String>createClientRegionFactory(ClientRegionShortcut.PROXY); Region<Integer, String> incomingRegion = incomingRegionFactory.setPoolName(poolName).create(INCOMING_REGION_NAME); // create another local region that matches the server region final ClientRegionFactory<String, String> outgoingRegionFactory = cache.<String, String>createClientRegionFactory(ClientRegionShortcut.PROXY); Region<String, String> outgoingRegion = outgoingRegionFactory.setPoolName(poolName).create(OUTGOING_REGION_NAME); new Example().checkWords(incomingRegion, outgoingRegion, Arrays.asList(new String[] {"that", "teh", "wil", "i'"})); cache.close(); }
it.addLocator(locator.getHost(), locator.getPort()));
it.addLocator(locator.getHost(), locator.getPort()));