use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class InterestListEndpointDUnitTest method stopILEndpointServer.
public static void stopILEndpointServer() {
try {
Cache c = CacheFactory.getAnyInstance();
assertEquals("More than one BridgeServer", 1, c.getCacheServers().size());
CacheServerImpl bs = (CacheServerImpl) c.getCacheServers().iterator().next();
assertNotNull(bs);
assertNotNull(bs.getAcceptor());
assertNotNull(bs.getAcceptor().getCacheClientNotifier());
Iterator iter_prox = bs.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
if (iter_prox.hasNext()) {
CacheClientProxy proxy = (CacheClientProxy) iter_prox.next();
// if (proxy._interestList._keysOfInterest.get("/"+REGION_NAME) != null) {
if (proxy.isPrimary()) {
Iterator iter = cache.getCacheServers().iterator();
if (iter.hasNext()) {
CacheServer server = (CacheServer) iter.next();
cache.getLogger().fine("stopping server " + server);
server.stop();
}
}
}
} catch (Exception ex) {
throw new RuntimeException("Exception while setting stopServer ", ex);
}
}
Aggregations