use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class RemoveClientFromBlacklistMessage method process.
@Override
protected void process(DistributionManager dm) {
final Cache cache;
try {
// use GemFireCache.getInstance to avoid blocking during cache.xml
// processing.
cache = GemFireCacheImpl.getInstance();
} catch (Exception ignore) {
DistributedSystem ds = dm.getSystem();
if (ds != null) {
if (logger.isTraceEnabled()) {
logger.trace("The node does not contain cache & so QDM Message will return.", ignore);
}
}
return;
}
Cache c = GemFireCacheImpl.getInstance();
if (c != null) {
List l = c.getCacheServers();
if (l != null) {
Iterator i = l.iterator();
while (i.hasNext()) {
CacheServerImpl bs = (CacheServerImpl) i.next();
CacheClientNotifier ccn = bs.getAcceptor().getCacheClientNotifier();
Set s = ccn.getBlacklistedClient();
if (s != null) {
if (s.remove(proxyID)) {
DistributedSystem ds = dm.getSystem();
if (ds != null) {
if (logger.isDebugEnabled()) {
logger.debug("Remove the client from black list as its queue is already destroyed: {}", proxyID);
}
}
}
}
}
}
}
}
use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class RegionCloseDUnitTest method VerifyClientProxyOnServerBeforeClose.
public static void VerifyClientProxyOnServerBeforeClose() {
Cache c = CacheFactory.getAnyInstance();
assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
final CacheServerImpl bs = (CacheServerImpl) c.getCacheServers().iterator().next();
WaitCriterion ev = new WaitCriterion() {
public boolean done() {
return bs.getAcceptor().getCacheClientNotifier().getClientProxies().size() == 1;
}
public String description() {
return null;
}
};
Wait.waitForCriterion(ev, 15 * 1000, 200, true);
assertEquals(1, bs.getAcceptor().getCacheClientNotifier().getClientProxies().size());
Iterator iter = bs.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
if (iter.hasNext()) {
CacheClientProxy proxy = (CacheClientProxy) iter.next();
clientMembershipId = proxy.getProxyID().toString();
assertNotNull(proxy.getHARegion());
}
}
use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class RedundancyLevelTestBase method verifyCCP.
public static void verifyCCP() {
try {
WaitCriterion wc = new WaitCriterion() {
String excuse;
public boolean done() {
return cache.getCacheServers().size() == 1;
}
public String description() {
return excuse;
}
};
Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
CacheServerImpl bs = (CacheServerImpl) cache.getCacheServers().iterator().next();
assertNotNull(bs);
assertNotNull(bs.getAcceptor());
assertNotNull(bs.getAcceptor().getCacheClientNotifier());
// one client is connected to this server
final CacheClientNotifier ccn = bs.getAcceptor().getCacheClientNotifier();
wc = new WaitCriterion() {
String excuse;
public boolean done() {
return ccn.getClientProxies().size() == 1;
}
public String description() {
return excuse;
}
};
Wait.waitForCriterion(wc, 3 * 60 * 1000, 1000, true);
} catch (Exception ex) {
Assert.fail("exception in verifyCCP()", ex);
}
}
use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class Bug37210DUnitTest method closeCacheClientProxyAndVerifyStats.
/**
* Close the CacheClientProxy of the client on the server and verify that ha-stats are closed and
* the entry for the region is removed from dispatchedMessagesMap.
*
*/
public static void closeCacheClientProxyAndVerifyStats() {
assertEquals("More than one BridgeServers found ", 1, cache.getCacheServers().size());
CacheServerImpl bs = (CacheServerImpl) cache.getCacheServers().iterator().next();
assertNotNull(bs);
assertNotNull(bs.getAcceptor());
assertNotNull(bs.getAcceptor().getCacheClientNotifier());
Iterator proxies = bs.getAcceptor().getCacheClientNotifier().getClientProxies().iterator();
assertTrue("No proxy found", proxies.hasNext());
CacheClientProxy proxy = (CacheClientProxy) proxies.next();
Map dispatchedMsgMap = HARegionQueue.getDispatchedMessagesMapForTesting();
HARegionQueue rq = proxy.getHARegionQueue();
Object value = dispatchedMsgMap.get(rq.getRegion().getName());
proxy.close();
assertTrue("HARegionQueue stats were not closed on proxy.close()", rq.getStatistics().isClosed());
}
use of org.apache.geode.internal.cache.CacheServerImpl in project geode by apache.
the class InterestListRecoveryDUnitTest method getCacheClientProxies.
public static Set getCacheClientProxies() {
Cache c = CacheFactory.getAnyInstance();
assertEquals("More than one CacheServer", 1, c.getCacheServers().size());
CacheServerImpl bs = (CacheServerImpl) c.getCacheServers().iterator().next();
assertNotNull(bs);
assertNotNull(bs.getAcceptor());
assertNotNull(bs.getAcceptor().getCacheClientNotifier());
return new HashSet(bs.getAcceptor().getCacheClientNotifier().getClientProxies());
}
Aggregations