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


Java DOMDataTreeChangeListener类代码示例

本文整理汇总了Java中org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener的典型用法代码示例。如果您正苦于以下问题:Java DOMDataTreeChangeListener类的具体用法?Java DOMDataTreeChangeListener怎么用?Java DOMDataTreeChangeListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: registerTreeChangeListener

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
@Override
public <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
        registerTreeChangeListener(final YangInstanceIdentifier path, final L listener) {
    takeLock();
    try {
        return setupListenerContext(path, listener);
    } finally {
        releaseLock();
    }
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:DistributedShardChangePublisher.java

示例2: setupListenerContext

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
        setupListenerContext(final YangInstanceIdentifier listenerPath, final L listener) {
    // we need to register the listener registration path based on the shards root
    // we have to strip the shard path from the listener path and then register
    YangInstanceIdentifier strippedIdentifier = listenerPath;
    if (!shardPath.isEmpty()) {
        strippedIdentifier = YangInstanceIdentifier.create(stripShardPath(shardPath, listenerPath));
    }

    final DOMDataTreeListenerWithSubshards subshardListener =
            new DOMDataTreeListenerWithSubshards(strippedIdentifier, listener);
    final AbstractDOMDataTreeChangeListenerRegistration<L> reg =
            setupContextWithoutSubshards(listenerPath, strippedIdentifier, subshardListener);

    for (final ChildShardContext maybeAffected : childShards.values()) {
        if (listenerPath.contains(maybeAffected.getPrefix().getRootIdentifier())) {
            // consumer has initialDataChangeEvent subshard somewhere on lower level
            // register to the notification manager with snapshot and forward child notifications to parent
            LOG.debug("Adding new subshard{{}} to listener at {}", maybeAffected.getPrefix(), listenerPath);
            subshardListener.addSubshard(maybeAffected);
        } else if (maybeAffected.getPrefix().getRootIdentifier().contains(listenerPath)) {
            // bind path is inside subshard
            // TODO can this happen? seems like in ShardedDOMDataTree we are
            // already registering to the lowest shard possible
            throw new UnsupportedOperationException("Listener should be registered directly "
                    + "into initialDataChangeEvent subshard");
        }
    }

    return reg;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:32,代码来源:DistributedShardChangePublisher.java

示例3: setupContextWithoutSubshards

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
private <L extends DOMDataTreeChangeListener> AbstractDOMDataTreeChangeListenerRegistration<L>
        setupContextWithoutSubshards(final YangInstanceIdentifier shardLookup,
                                     final YangInstanceIdentifier listenerPath,
                                     final DOMDataTreeListenerWithSubshards listener) {

    LOG.debug("Registering root listener full path: {}, path inside shard: {}", shardLookup, listenerPath);

    // register in the shard tree
    final RegistrationTreeNode<AbstractDOMDataTreeChangeListenerRegistration<?>> node =
            findNodeFor(listenerPath.getPathArguments());

    // register listener in CDS
    final ProxyRegistration proxyReg = new ProxyRegistration(distributedDataStore
            .registerProxyListener(shardLookup, listenerPath, listener), listener);

    @SuppressWarnings("unchecked")
    final AbstractDOMDataTreeChangeListenerRegistration<L> registration =
        new AbstractDOMDataTreeChangeListenerRegistration<L>((L) listener) {
            @Override
            protected void removeRegistration() {
                listener.close();
                DistributedShardChangePublisher.this.removeRegistration(node, this);
                registrationRemoved(this);
                proxyReg.close();
            }
        };
    addRegistration(node, registration);

    return registration;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:31,代码来源:DistributedShardChangePublisher.java

示例4: ProxyRegistration

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
private ProxyRegistration(
        final ListenerRegistration<
                org.opendaylight.controller.md.sal.dom.api.DOMDataTreeChangeListener> proxy,
        final DOMDataTreeChangeListener listener) {
    this.proxy = proxy;
    this.listener = listener;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:8,代码来源:DistributedShardChangePublisher.java

示例5: registerTreeChangeListener

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
@Nonnull
@Override
public <L extends DOMDataTreeChangeListener> ListenerRegistration<L> registerTreeChangeListener(
        final YangInstanceIdentifier treeId, final L listener) {
    return publisher.registerTreeChangeListener(treeId, listener);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:DistributedShardFrontend.java

示例6: getInstance

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
@Override
public DOMDataTreeChangeListener getInstance() {
    return listener;
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DistributedShardChangePublisher.java

示例7: DOMDataTreeListenerWithSubshards

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
DOMDataTreeListenerWithSubshards(final YangInstanceIdentifier listenerPath,
                                 final DOMDataTreeChangeListener delegate) {
    this.listenerPath = Preconditions.checkNotNull(listenerPath);
    this.delegate = Preconditions.checkNotNull(delegate);
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:6,代码来源:DistributedShardChangePublisher.java

示例8: close

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
void close() {
    for (final ListenerRegistration<DOMDataTreeChangeListener> registration : registrations.values()) {
        registration.close();
    }
    registrations.clear();
}
 
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:DistributedShardChangePublisher.java

示例9: watch

import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
/**
 * Registers a Change Listener with the Cache.
 * @param iid - Instance Identifier to Monitor
 * @param listener - Listener to be registered
 * @return Listener Registration
 */
public ListenerRegistration<DOMDataTreeChangeListener> watch(YangInstanceIdentifier iid,
        DOMDataTreeChangeListener listener) {
    return memoryCache.registerTreeChangeListener(iid, listener);
}
 
开发者ID:opendaylight,项目名称:fpc,代码行数:11,代码来源:StorageCache.java


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