當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。