本文整理汇总了Java中org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type.NODE_ADDED属性的典型用法代码示例。如果您正苦于以下问题:Java Type.NODE_ADDED属性的具体用法?Java Type.NODE_ADDED怎么用?Java Type.NODE_ADDED使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.curator.framework.recipes.cache.TreeCacheEvent.Type
的用法示例。
在下文中一共展示了Type.NODE_ADDED属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dataChanged
@Override
protected void dataChanged(final CuratorFramework client, final TreeCacheEvent event, final String path) {
if (!serverNode.isLocalJobPausedPath(path)) {
return;
}
JobScheduleController jobScheduleController = JobRegistry.getInstance().getJobScheduleController(jobName);
if (null == jobScheduleController) {
return;
}
if (Type.NODE_ADDED == event.getType()) {
jobScheduleController.pauseJob();
}
if (Type.NODE_REMOVED == event.getType()) {
jobScheduleController.resumeJob();
serverService.clearJobPausedStatus();
}
}
示例2: 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;
}
}
示例3: isServerDisabled
private boolean isServerDisabled() {
return serverNode.isLocalServerDisabledPath(path) && Type.NODE_ADDED == event.getType();
}
示例4: isServerPaused
private boolean isServerPaused() {
return serverNode.isLocalJobPausedPath(path) && Type.NODE_ADDED == event.getType();
}
示例5: isServerShutdown
private boolean isServerShutdown() {
return serverNode.isLocalJobShutdownPath(path) && Type.NODE_ADDED == event.getType();
}