use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class RegionManagementDUnitTest method awaitDistributedRegionMXBean.
private DistributedRegionMXBean awaitDistributedRegionMXBean(final String name, final int memberCount) {
SystemManagementService service = getSystemManagementService_tmp();
await().until(() -> assertThat(service.getDistributedRegionMXBean(name)).isNotNull());
await().until(() -> assertThat(service.getDistributedRegionMXBean(name).getMemberCount()).isEqualTo(memberCount));
return service.getDistributedRegionMXBean(name);
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getMemberMbeanProxy.
/**
* Utility Method to obtain MemberMXBean proxy reference for a particular Member
*
* @param member
* @return a reference to MemberMXBean
* @throws Exception
*/
public static MemberMXBean getMemberMbeanProxy(DistributedMember member) throws Exception {
MemberMXBean bean = null;
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName memberMBeanName = service.getMemberMBeanName(member);
Wait.waitForCriterion(new WaitCriterion() {
MemberMXBean bean = null;
public String description() {
return "Waiting for the proxy to get reflected at managing node";
}
public boolean done() {
bean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
boolean done = bean != null;
return done;
}
}, MAX_WAIT, 500, true);
try {
bean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :MemberMBean Proxy Should Not be Empty for : " + memberMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.management.internal.SystemManagementService 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.management.internal.SystemManagementService 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.management.internal.SystemManagementService in project geode by apache.
the class RegionManagementDUnitTest method awaitRegionMXBeanProxy.
private RegionMXBean awaitRegionMXBeanProxy(final DistributedMember member, final String name) {
SystemManagementService service = getSystemManagementService_tmp();
ObjectName objectName = service.getRegionMBeanName(member, name);
String alias = "awaiting RegionMXBean proxy for " + member;
await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, RegionMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, RegionMXBean.class);
}
Aggregations