use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class CompositeTypeTestDUnitTest method registerMBeanWithCompositeTypeGetters.
private void registerMBeanWithCompositeTypeGetters(final VM memberVM) {
memberVM.invoke("registerMBeanWithCompositeTypeGetters", () -> {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = new ObjectName("GemFire:service=custom,type=composite");
CompositeTestMXBean compositeTestMXBean = new CompositeTestMBean();
objectName = service.registerMBean(compositeTestMXBean, objectName);
service.federate(objectName, CompositeTestMXBean.class, false);
});
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class DLockManagementDUnitTest method awaitLockServiceMXBeanProxy.
/**
* Await and return a LockServiceMXBean proxy for a specific member and lockServiceName.
*/
private LockServiceMXBean awaitLockServiceMXBeanProxy(final DistributedMember member, final String lockServiceName) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName lockServiceMXBeanName = service.getLockServiceMBeanName(member, lockServiceName);
await().until(() -> assertThat(service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class)).isNotNull());
return service.getMBeanProxy(lockServiceMXBeanName, LockServiceMXBean.class);
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class CacheManagementDUnitTest method awaitMemberMXBeanProxy.
private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
ObjectName objectName = service.getMemberMBeanName(member);
String alias = "Awaiting MemberMXBean proxy for " + member;
await(alias).until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
return service.getMBeanProxy(objectName, MemberMXBean.class);
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class CacheManagementDUnitTest method createNotificationRegion.
private void createNotificationRegion(final String memberId) {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
Map<ObjectName, NotificationHubListener> notificationHubListenerMap = service.getNotificationHub().getListenerObjectMap();
await().until(() -> assertThat(notificationHubListenerMap.size()).isEqualTo(1));
RegionFactory regionFactory = this.managementTestRule.getCache().createRegionFactory(RegionShortcut.REPLICATE);
for (int i = 1; i <= 15; i++) {
regionFactory.create(NOTIFICATION_REGION_NAME + i);
}
Region region = this.managementTestRule.getCache().getRegion(ManagementConstants.NOTIFICATION_REGION + "_" + memberId);
assertThat(region).isEmpty();
}
use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.
the class CacheManagementDUnitTest method verifyManagerStarted.
private void verifyManagerStarted(final VM managerVM, final DistributedMember otherMember) {
managerVM.invoke("verifyManagerStarted", () -> {
SystemManagementService service = this.managementTestRule.getSystemManagementService();
assertThat(service.isManager()).isTrue();
assertThat(service.getLocalManager().isRunning()).isTrue();
assertThat(service.getLocalManager().getFederationSheduler().isShutdown()).isFalse();
ObjectName memberMBeanName = service.getMemberMBeanName(otherMember);
await().until(() -> assertThat(service.getMBeanProxy(memberMBeanName, MemberMXBean.class)).isNotNull());
MemberMXBean memberMXBean = service.getMBeanProxy(memberMBeanName, MemberMXBean.class);
// Ensure Data getting federated from Managing node
long start = memberMXBean.getMemberUpTime();
await().until(() -> assertThat(memberMXBean.getMemberUpTime()).isGreaterThan(start));
});
}
Aggregations