本文整理汇总了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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例6: getInstance
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
@Override
public DOMDataTreeChangeListener getInstance() {
return listener;
}
示例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);
}
示例8: close
import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeListener; //导入依赖的package包/类
void close() {
for (final ListenerRegistration<DOMDataTreeChangeListener> registration : registrations.values()) {
registration.close();
}
registrations.clear();
}
示例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);
}