当前位置: 首页>>代码示例>>Java>>正文


Java Type.NODE_UPDATED属性代码示例

本文整理汇总了Java中org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_UPDATED属性的典型用法代码示例。如果您正苦于以下问题:Java Type.NODE_UPDATED属性的具体用法?Java Type.NODE_UPDATED怎么用?Java Type.NODE_UPDATED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type的用法示例。


在下文中一共展示了Type.NODE_UPDATED属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: childEvent

@Override
public void childEvent(CuratorFramework client, TreeCacheEvent event) throws Exception {
    ChildData eventData = event.getData();

    if (event.getType() == Type.CONNECTION_RECONNECTED) {
        LOGGER.traceMarker("ZK-Event", "========= Reconnect =========");
        registerZkNodeAndWatch();
        return;
    }

    if (event.getType() == Type.CONNECTION_LOST) {
        LOGGER.traceMarker("ZK-Event", "========= Lost =========");
        return;
    }

    if (event.getType() == Type.INITIALIZED) {
        LOGGER.traceMarker("ZK-Event", "========= Initialized =========");
        return;
    }

    if (event.getType() == Type.NODE_ADDED) {
        LOGGER.traceMarker("ZK-Event", "========= Node Added: %s =========", eventData.getPath());
        return;
    }

    if (event.getType() == Type.NODE_UPDATED) {
        LOGGER.traceMarker("ZK-Event", "========= Node Updated: %s =========", eventData.getPath());
        onDataChanged(eventData.getPath());
        return;
    }

    if (event.getType() == Type.NODE_REMOVED) {
        LOGGER.traceMarker("ZK-Event", "========= Node Removed: %s =========", eventData.getPath());
        close();
        return;
    }
}
 
开发者ID:FlowCI,项目名称:flow-platform,代码行数:37,代码来源:AgentManager.java

示例2: dataChanged

@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
    if (configNode.isMonitorExecutionPath(path) && Type.NODE_UPDATED == event.getType()) {
        if (!Boolean.valueOf(new String(event.getData().getData()))) {
            executionService.removeExecutionInfo();
        }
    }
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:8,代码来源:ExecutionListenerManager.java

示例3: dataChanged

@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
    if (configNode.isFailoverPath(path) && Type.NODE_UPDATED == event.getType()) {
        if (!Boolean.valueOf(new String(event.getData().getData()))) {
            failoverService.removeFailoverInfo();
        }
    }
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:8,代码来源:FailoverListenerManager.java

示例4: dataChanged

@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
    if (configNode.isCronPath(path) && Type.NODE_UPDATED == event.getType()) {
        String cronExpression = new String(event.getData().getData());
        JobScheduleController jobScheduler = JobRegistry.getInstance().getJobScheduleController(jobName);
        if (null != jobScheduler) {
            jobScheduler.rescheduleJob(cronExpression);
        }
    }
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:10,代码来源:ConfigurationListenerManager.java

示例5: dataChanged

@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
	// 全局分片策略监听
    if (GlobalNodePath.isShardingStrategyPath(path)) {
        if (Type.NODE_UPDATED == event.getType()) {
        	JobShardingStrategyCache.reLoadGlobalStrategy(globalConfigurationService, getStrategyPath(path));
        }
        if (Type.NODE_REMOVED == event.getType()) {
        	JobShardingStrategyCache.removeStrategy(getStrategyPath(path));
        }
    }

}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:13,代码来源:GlobalConfigListenerManager.java

示例6: isServersCrashed

private boolean isServersCrashed(final TreeCacheEvent event, final String path) {
    return serverNode.isServerStatusPath(path) && Type.NODE_UPDATED != event.getType();
}
 
开发者ID:artoderk,项目名称:elastic-jobx,代码行数:3,代码来源:ShardingListenerManager.java

示例7: pushEvent

/**
 * 发布事件
 * 
 * @param event 配置节点变更事件
 * @param path 配置节点路径
 * @param value 配置节点新值
 * @param oldvalue 配置节点原始值
 */
private void pushEvent(final TreeCacheEvent event, String path, String value) {

    if (event.getType() == Type.NODE_UPDATED) {
        ElasticConfigEventBus.pushEvent(ElasticConfigEvent.builder().path(path).value(value)
            .eventType(eventMap.get(event.getType())).build());
    }
}
 
开发者ID:ErinDavid,项目名称:elastic-config,代码行数:15,代码来源:ZookeeperListenerManager.java


注:本文中的org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_UPDATED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。