use of org.apache.geode.internal.cache.GemFireCacheImpl in project geode by apache.
the class UnregisterInterestDUnitTest method checkAllKeys.
public static void checkAllKeys(Integer value, Integer valueInv) {
FilterProfile fp = ((GemFireCacheImpl) cache).getFilterProfile(regionname);
assertEquals(value.intValue(), fp.getAllKeyClientsSize());
assertEquals(valueInv.intValue(), fp.getAllKeyClientsInvSize());
}
use of org.apache.geode.internal.cache.GemFireCacheImpl in project geode by apache.
the class UnregisterInterestDUnitTest method createClientCache.
public static void createClientCache(Host host, Integer port) throws Exception {
DistributedSystem ds = new UnregisterInterestDUnitTest().getSystem();
ds.disconnect();
Properties props = new Properties();
props.setProperty(LOCATORS, "");
props.setProperty(MCAST_PORT, "0");
ClientCacheFactory ccf = new ClientCacheFactory(props);
ccf.setPoolSubscriptionEnabled(true);
ccf.addPoolServer(host.getHostName(), port);
cache = ccf.create();
ClientRegionFactory crf = ((GemFireCacheImpl) cache).createClientRegionFactory(ClientRegionShortcut.CACHING_PROXY);
crf.create(regionname);
}
use of org.apache.geode.internal.cache.GemFireCacheImpl in project geode by apache.
the class MBeanUtil method getLocatorMbeanProxy.
/**
* Utility Method to obtain GatewayReceiverMXBean proxy reference for a member
*
* @param member distributed member
* @return a reference to GatewayReceiverMXBean
* @throws Exception
*/
public static LocatorMXBean getLocatorMbeanProxy(DistributedMember member) throws Exception {
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName locatorMBeanName = service.getLocatorMBeanName(member);
Wait.waitForCriterion(new WaitCriterion() {
LocatorMXBean bean = null;
public String description() {
return "Waiting for the proxy to get reflected at managing node";
}
public boolean done() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
bean = service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class);
boolean done = (bean != null);
return done;
}
}, MAX_WAIT, 500, true);
LocatorMXBean bean = null;
try {
bean = service.getMBeanProxy(locatorMBeanName, LocatorMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :Locator MBean Proxy Should Not be Empty for : " + locatorMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.internal.cache.GemFireCacheImpl in project geode by apache.
the class MBeanUtil method getGatewayReceiverMbeanProxy.
/**
* Utility Method to obtain GatewayReceiverMXBean proxy reference for a member
*
* @param member distributed member
* @return a reference to GatewayReceiverMXBean
* @throws Exception
*/
public static GatewayReceiverMXBean getGatewayReceiverMbeanProxy(DistributedMember member) throws Exception {
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName receiverMBeanName = service.getGatewayReceiverMBeanName(member);
Wait.waitForCriterion(new WaitCriterion() {
GatewayReceiverMXBean bean = null;
public String description() {
return "Waiting for the proxy to get reflected at managing node";
}
public boolean done() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
bean = service.getMBeanProxy(receiverMBeanName, GatewayReceiverMXBean.class);
boolean done = (bean != null);
return done;
}
}, MAX_WAIT, 500, true);
GatewayReceiverMXBean bean = null;
try {
bean = service.getMBeanProxy(receiverMBeanName, GatewayReceiverMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :GatewaySender MBean Proxy Should Not be Empty for : " + receiverMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.internal.cache.GemFireCacheImpl in project geode by apache.
the class ManagementTestBase method createDistributedRegionAsync.
/**
* Creates a Distributed Region
*/
private AsyncInvocation createDistributedRegionAsync(final VM vm, final String regionName) {
return vm.invokeAsync("Create Distributed region", () -> {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
SystemManagementService service = (SystemManagementService) getManagementService();
RegionFactory rf = cache.createRegionFactory(RegionShortcut.REPLICATE);
LogWriterUtils.getLogWriter().info("Creating Dist Region");
rf.create(regionName);
});
}
Aggregations