Search in sources :

Example 11 with SystemManagementService

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);
    });
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 12 with SystemManagementService

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);
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 13 with SystemManagementService

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);
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 14 with SystemManagementService

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();
}
Also used : NotificationHubListener(org.apache.geode.management.internal.NotificationHub.NotificationHubListener) RegionFactory(org.apache.geode.cache.RegionFactory) Region(org.apache.geode.cache.Region) SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 15 with SystemManagementService

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));
    });
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Aggregations

SystemManagementService (org.apache.geode.management.internal.SystemManagementService)83 ObjectName (javax.management.ObjectName)56 DistributedMember (org.apache.geode.distributed.DistributedMember)31 CacheServerMXBean (org.apache.geode.management.CacheServerMXBean)15 InternalCache (org.apache.geode.internal.cache.InternalCache)14 VM (org.apache.geode.test.dunit.VM)14 TabularResultData (org.apache.geode.management.internal.cli.result.TabularResultData)13 GemFireCacheImpl (org.apache.geode.internal.cache.GemFireCacheImpl)12 ExecutionException (java.util.concurrent.ExecutionException)11 CliMetaData (org.apache.geode.management.cli.CliMetaData)11 Result (org.apache.geode.management.cli.Result)11 CommandResultException (org.apache.geode.management.internal.cli.result.CommandResultException)11 ResourceOperation (org.apache.geode.management.internal.security.ResourceOperation)11 CliCommand (org.springframework.shell.core.annotation.CliCommand)11 CliFunctionResult (org.apache.geode.management.internal.cli.functions.CliFunctionResult)10 WaitCriterion (org.apache.geode.test.dunit.WaitCriterion)8 Test (org.junit.Test)8 GatewaySenderMXBean (org.apache.geode.management.GatewaySenderMXBean)7 CompositeResultData (org.apache.geode.management.internal.cli.result.CompositeResultData)7 DistributedTest (org.apache.geode.test.junit.categories.DistributedTest)7