use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getAsyncEventQueueMBeanProxy.
/**
* Utility Method to obtain AsyncEventQueueMXBean proxy reference for a particular queue id on a
* member
*
* @param member distributed member
* @param queueId Queue id
* @return a reference to AsyncEventQueueMXBean
* @throws Exception
*/
public static AsyncEventQueueMXBean getAsyncEventQueueMBeanProxy(DistributedMember member, String queueId) throws Exception {
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName queueMBeanName = service.getAsyncEventQueueMBeanName(member, queueId);
Wait.waitForCriterion(new WaitCriterion() {
AsyncEventQueueMXBean 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(queueMBeanName, AsyncEventQueueMXBean.class);
boolean done = (bean != null);
return done;
}
}, MAX_WAIT, 500, true);
AsyncEventQueueMXBean bean = null;
try {
bean = service.getMBeanProxy(queueMBeanName, AsyncEventQueueMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :Async Event Queue MBean Proxy Should Not be Empty for : " + queueMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getLockServiceMbeanProxy.
/**
* Utility Method to obtain LockServiceMXBean proxy reference for a particular lock service on a
* Member
*
* @param member
* @return a reference to LockServiceMXBean
* @throws Exception
*/
public static LockServiceMXBean getLockServiceMbeanProxy(DistributedMember member, String lockServiceName) throws Exception {
LockServiceMXBean bean = null;
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName lockServiceMBeanName = service.getLockServiceMBeanName(member, lockServiceName);
Wait.waitForCriterion(new WaitCriterion() {
LockServiceMXBean bean = null;
public String description() {
return "Waiting for the proxy to get reflected at managing node";
}
public boolean done() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
bean = service.getMBeanProxy(lockServiceMBeanName, LockServiceMXBean.class);
boolean done = bean != null;
return done;
}
}, MAX_WAIT, 500, true);
try {
bean = service.getMBeanProxy(lockServiceMBeanName, LockServiceMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :LockService Proxy Should Not be Empty for : " + lockServiceMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getGatewaySenderMbeanProxy.
/**
* Utility Method to obtain GatewaySenderMXBean proxy reference for a particular sender id on a
* member
*
* @param member distributed member
* @param gatwaySenderId sender id
* @return a reference to GatewaySenderMXBean
* @throws Exception
*/
public static GatewaySenderMXBean getGatewaySenderMbeanProxy(DistributedMember member, String gatwaySenderId) throws Exception {
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName senderMBeanName = service.getGatewaySenderMBeanName(member, gatwaySenderId);
Wait.waitForCriterion(new WaitCriterion() {
GatewaySenderMXBean 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(senderMBeanName, GatewaySenderMXBean.class);
boolean done = (bean != null);
return done;
}
}, MAX_WAIT, 500, true);
GatewaySenderMXBean bean = null;
try {
bean = service.getMBeanProxy(senderMBeanName, GatewaySenderMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :GatewaySender MBean Proxy Should Not be Empty for : " + senderMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getRegionMbeanProxy.
/**
* Utility Method to obtain RegionMXBean proxy reference for a particular region on a member
*
* @param member
* @return a reference to RegionMXBean
* @throws Exception
*/
public static RegionMXBean getRegionMbeanProxy(DistributedMember member, String regionPath) throws Exception {
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName regionMBeanName = service.getRegionMBeanName(member, regionPath);
Wait.waitForCriterion(new WaitCriterion() {
RegionMXBean 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(regionMBeanName, RegionMXBean.class);
boolean done = (bean != null);
return done;
}
}, MAX_WAIT, 500, true);
RegionMXBean bean = null;
try {
bean = service.getMBeanProxy(regionMBeanName, RegionMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :RegionMBean Proxy Should Not be Empty for : " + regionMBeanName.getCanonicalName());
}
}
return bean;
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class MBeanUtil method getCacheServerMbeanProxy.
/**
* Utility Method to obtain CacheServerMXBean proxy reference for a particular Member
*
* @param member
* @return a reference to CacheServerMXBean
* @throws Exception
*/
public static CacheServerMXBean getCacheServerMbeanProxy(DistributedMember member, int port) throws Exception {
CacheServerMXBean bean = null;
final SystemManagementService service = (SystemManagementService) ManagementTestBase.getManagementService();
final ObjectName cacheServerMBeanName = service.getCacheServerMBeanName(port, member);
Wait.waitForCriterion(new WaitCriterion() {
CacheServerMXBean bean = null;
public String description() {
return "Waiting for the proxy to get reflected at managing node";
}
public boolean done() {
GemFireCacheImpl cache = GemFireCacheImpl.getInstance();
GemFireCacheImpl cacheImpl = (GemFireCacheImpl) cache;
bean = service.getMBeanProxy(cacheServerMBeanName, CacheServerMXBean.class);
boolean done = bean != null;
return done;
}
}, MAX_WAIT, 500, true);
try {
bean = service.getMBeanProxy(cacheServerMBeanName, CacheServerMXBean.class);
} catch (ManagementException mgz) {
if (bean == null) {
InternalDistributedSystem.getLoggerI18n().fine("Undesired Result :CacheServer Proxy Should Not be Empty for : " + cacheServerMBeanName.getCanonicalName());
}
}
return bean;
}
Aggregations