Search in sources :

Example 61 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method verifyReplicatedRegionAfterClose.

private void verifyReplicatedRegionAfterClose(final VM memberVM) {
    memberVM.invoke("verifyReplicatedRegionAfterClose", () -> {
        SystemManagementService service = getSystemManagementService_tmp();
        RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
        assertThat(regionMXBean).isNull();
        ObjectName objectName = service.getRegionMBeanName(getCache_tmp().getDistributedSystem().getDistributedMember(), REGION_PATH);
        assertThat(service.getLocalManager().getManagementResourceRepo().getEntryFromLocalMonitoringRegion(objectName)).isNull();
    });
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService) ObjectName(javax.management.ObjectName)

Example 62 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method verifyProxyCleanup.

// <[javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.created][message=Region
// Created With Name /MANAGEMENT_TEST_REGION],
// javax.management.Notification[source=192.168.1.72(18497)<v28>-32771][type=gemfire.distributedsystem.cache.region.closed][message=Region
// Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
// javax.management.Notification[source=192.168.1.72(18498)<v29>-32772][type=gemfire.distributedsystem.cache.region.closed][message=Region
// Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
// javax.management.Notification[source=192.168.1.72(18499)<v30>-32773][type=gemfire.distributedsystem.cache.region.closed][message=Region
// Destroyed/Closed With Name /MANAGEMENT_TEST_REGION],
// javax.management.Notification[source=192.168.1.72(18496)<v27>-32770][type=gemfire.distributedsystem.cache.region.closed][message=Region
// Destroyed/Closed With Name /MANAGEMENT_TEST_REGION]]>
private void verifyProxyCleanup(final VM managerVM) {
    managerVM.invoke("verifyProxyCleanup", () -> {
        SystemManagementService service = getSystemManagementService_tmp();
        Set<DistributedMember> otherMemberSet = getOtherNormalMembers_tmp();
        for (final DistributedMember member : otherMemberSet) {
            String alias = "Waiting for the proxy to get deleted at managing node";
            await(alias).until(() -> assertThat(service.getMBeanProxy(service.getRegionMBeanName(member, REGION_PATH), RegionMXBean.class)).isNull());
        }
    });
}
Also used : DistributedMember(org.apache.geode.distributed.DistributedMember) SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Example 63 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method verifyReplicateRegionAfterCreate.

private void verifyReplicateRegionAfterCreate(final VM memberVM) {
    memberVM.invoke("verifyReplicateRegionAfterCreate", () -> {
        Cache cache = getCache_tmp();
        String memberId = MBeanJMXAdapter.getMemberNameOrId(cache.getDistributedSystem().getDistributedMember());
        ObjectName objectName = ObjectName.getInstance("GemFire:type=Member,member=" + memberId);
        // List<Notification> notifications = new ArrayList<>();
        // MEMBER_NOTIFICATIONS_REF.set(notifications);
        //
        // MemberNotificationListener listener = new MemberNotificationListener(notifications);
        // ManagementFactory.getPlatformMBeanServer().addNotificationListener(objectName, listener,
        // null, null);
        SystemManagementService service = getSystemManagementService_tmp();
        RegionMXBean regionMXBean = service.getLocalRegionMBean(REGION_PATH);
        assertThat(regionMXBean).isNotNull();
        Region region = cache.getRegion(REGION_PATH);
        RegionAttributes regionAttributes = region.getAttributes();
        RegionAttributesData regionAttributesData = regionMXBean.listRegionAttributes();
        verifyRegionAttributes(regionAttributes, regionAttributesData);
        MembershipAttributesData membershipData = regionMXBean.listMembershipAttributes();
        assertThat(membershipData).isNotNull();
        EvictionAttributesData evictionData = regionMXBean.listEvictionAttributes();
        assertThat(evictionData).isNotNull();
    });
}
Also used : RegionAttributes(org.apache.geode.cache.RegionAttributes) AbstractRegion(org.apache.geode.internal.cache.AbstractRegion) Region(org.apache.geode.cache.Region) SystemManagementService(org.apache.geode.management.internal.SystemManagementService) Cache(org.apache.geode.cache.Cache) ObjectName(javax.management.ObjectName)

Example 64 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method awaitMemberMXBeanProxy.

private MemberMXBean awaitMemberMXBeanProxy(final ObjectName objectName) {
    SystemManagementService service = getSystemManagementService_tmp();
    await().until(() -> assertThat(service.getMBeanProxy(objectName, MemberMXBean.class)).isNotNull());
    return service.getMBeanProxy(objectName, MemberMXBean.class);
}
Also used : SystemManagementService(org.apache.geode.management.internal.SystemManagementService)

Example 65 with SystemManagementService

use of org.apache.geode.management.internal.SystemManagementService in project geode by apache.

the class RegionManagementDUnitTest method awaitMemberMXBeanProxy.

private MemberMXBean awaitMemberMXBeanProxy(final DistributedMember member) {
    SystemManagementService service = getSystemManagementService_tmp();
    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)

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