gpt4 book ai didi

org.apache.helix.monitoring.mbeans.ZkClientMonitor.unregister()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:49:07 32 4
gpt4 key购买 nike

本文整理了Java中org.apache.helix.monitoring.mbeans.ZkClientMonitor.unregister()方法的一些代码示例,展示了ZkClientMonitor.unregister()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZkClientMonitor.unregister()方法的具体详情如下:
包路径:org.apache.helix.monitoring.mbeans.ZkClientMonitor
类名称:ZkClientMonitor
方法名:unregister

ZkClientMonitor.unregister介绍

[英]After unregistered, the MBean can't be registered again, a new monitor has be to created.
[中]注销后,MBean无法再次注册,必须创建一个新的监视器。

代码示例

代码示例来源:origin: org.apache.helix/helix-core

getEventLock().unlock();
if (_monitor != null) {
 _monitor.unregister();

代码示例来源:origin: apache/helix

@Test
public void testMBeanRegisteration() throws JMException {
 final String TEST_TAG_1 = "test_tag_1";
 final String TEST_KEY_1 = "test_key_1";
 ZkClientMonitor monitor = new ZkClientMonitor(TEST_TAG_1, TEST_KEY_1, null, true, null);
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 monitor.register();
 Assert.assertTrue(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 // no per-path monitor items created since "monitorRootPathOnly" = true
 Assert.assertFalse(_beanServer.isRegistered(
   buildPathMonitorObjectName(TEST_TAG_1, TEST_KEY_1, null,
     ZkClientPathMonitor.PredefinedPath.IdealStates.name())));
 ZkClientMonitor monitorDuplicate = new ZkClientMonitor(TEST_TAG_1, TEST_KEY_1, null, true, null);
 monitorDuplicate.register();
 Assert.assertTrue(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null, 1)));
 monitor.unregister();
 monitorDuplicate.unregister();
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null)));
 Assert.assertFalse(_beanServer.isRegistered(buildObjectName(TEST_TAG_1, TEST_KEY_1, null, 1)));
}

代码示例来源:origin: apache/helix

getEventLock().unlock();
if (_monitor != null) {
 _monitor.unregister();

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com