本文整理汇总了Java中org.opendaylight.yangtools.concepts.ObjectRegistration类的典型用法代码示例。如果您正苦于以下问题:Java ObjectRegistration类的具体用法?Java ObjectRegistration怎么用?Java ObjectRegistration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectRegistration类属于org.opendaylight.yangtools.concepts包,在下文中一共展示了ObjectRegistration类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: open
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
public void open(final BundleTracker<Collection<ObjectRegistration<YangModuleInfo>>> bundleTracker) {
LOG.debug("ModuleInfoBundleTracker open starting with bundleTracker {}", bundleTracker);
if (bundleTracker != null) {
this.bundleTracker = bundleTracker;
starting = true;
bundleTracker.open();
starting = false;
moduleInfoRegistry.updateService();
} else {
starting = false;
}
LOG.debug("ModuleInfoBundleTracker open complete");
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:ModuleInfoBundleTracker.java
示例2: removedBundle
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
@SuppressWarnings("IllegalCatch")
public void removedBundle(final Bundle bundle, final BundleEvent event,
final Collection<ObjectRegistration<YangModuleInfo>> regs) {
if (regs == null) {
return;
}
for (ObjectRegistration<YangModuleInfo> reg : regs) {
try {
reg.close();
} catch (final Exception e) {
LOG.error("Unable to unregister YangModuleInfo {}", reg.getInstance(), e);
}
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:17,代码来源:ModuleInfoBundleTracker.java
示例3: testConstructor
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Test
public void testConstructor() throws Exception {
final ModuleInfoRegistry reg = mock(ModuleInfoRegistry.class);
final SchemaContextProvider prov = mock(SchemaContextProvider.class);
doReturn("string").when(prov).toString();
final BundleContext ctxt = mock(BundleContext.class);
final ServiceRegistration<?> servReg = mock(ServiceRegistration.class);
doReturn(servReg).when(ctxt).registerService(any(Class.class), any(SchemaContextProvider.class),
any(Dictionary.class));
doReturn(servReg).when(ctxt).registerService(Mockito.anyString(), any(Object.class), any(Dictionary.class));
doNothing().when(servReg).setProperties(any(Dictionary.class));
final ClassLoadingStrategy classLoadingStrat = mock(ClassLoadingStrategy.class);
final BindingContextProvider codecRegistryProvider = mock(BindingContextProvider.class);
doNothing().when(codecRegistryProvider).update(classLoadingStrat, prov);
final BindingRuntimeContext bindingRuntimeContext = mock(BindingRuntimeContext.class);
doReturn("B-runtime-context").when(bindingRuntimeContext).toString();
doReturn(bindingRuntimeContext).when(codecRegistryProvider).getBindingContext();
final RefreshingSCPModuleInfoRegistry scpreg = new RefreshingSCPModuleInfoRegistry(reg, prov, classLoadingStrat,
this.sourceProvider, codecRegistryProvider, ctxt);
doNothing().when(servReg).unregister();
final YangModuleInfo modInfo = mock(YangModuleInfo.class);
doReturn("").when(modInfo).toString();
final ObjectRegistration<YangModuleInfo> ymi = mock(ObjectRegistration.class);
doReturn(ymi).when(reg).registerModuleInfo(modInfo);
scpreg.registerModuleInfo(modInfo);
scpreg.updateService();
verify(codecRegistryProvider).update(classLoadingStrat, prov);
scpreg.close();
Mockito.verify(servReg, Mockito.times(1)).setProperties(any(Dictionary.class));
Mockito.verify(servReg, Mockito.times(1)).unregister();
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:40,代码来源:RefreshingSCPModuleInfoRegistryTest.java
示例4: registerMountPoint
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
public ObjectRegistration<DOMMountPoint> registerMountPoint(final DOMMountPoint mountPoint) {
synchronized (mountPoints) {
Preconditions.checkState(!mountPoints.containsKey(mountPoint.getIdentifier()), "Mount point already exists");
mountPoints.put(mountPoint.getIdentifier(), mountPoint);
}
notifyMountCreated(mountPoint.getIdentifier());
return new MountRegistration(mountPoint);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:10,代码来源:DOMMountPointServiceImpl.java
示例5: unregisterPath
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public synchronized void unregisterPath(final Class<? extends BaseIdentity> context, final InstanceIdentifier<?> path) {
final ObjectRegistration<T> reg = registrations.remove(path);
if(reg != null) {
try {
reg.close();
} catch (final Exception e) {
// FIXME: Once we have proper subclass of ObjectRegistrationo
throw Throwables.propagate(e);
}
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:13,代码来源:CompositeRoutedRpcRegistration.java
示例6: close
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public synchronized void close() {
try {
for(final ObjectRegistration<T> reg : registrations.values()) {
reg.close();
}
} catch (final Exception e) {
throw Throwables.propagate(e);
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:11,代码来源:CompositeRoutedRpcRegistration.java
示例7: register
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
private <S extends RpcService, T extends S> ObjectRegistration<T> register(final Class<S> type, final T implementation, final Collection<YangInstanceIdentifier> rpcContextPaths) {
final Map<SchemaPath, Method> rpcs = codec.getRpcMethodToSchemaPath(type).inverse();
final BindingDOMRpcImplementationAdapter adapter = new BindingDOMRpcImplementationAdapter(codec.getCodecRegistry(), type, rpcs, implementation);
final Set<DOMRpcIdentifier> domRpcs = createDomRpcIdentifiers(rpcs.keySet(), rpcContextPaths);
final DOMRpcImplementationRegistration<?> domReg = domRpcRegistry.registerRpcImplementation(adapter, domRpcs);
return new BindingRpcAdapterRegistration<>(implementation, domReg);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:9,代码来源:BindingDOMRpcProviderServiceAdapter.java
示例8: modifiedBundle
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public void modifiedBundle(final Bundle bundle, final BundleEvent event,
final Collection<ObjectRegistration<YangModuleInfo>> object) {
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:ModuleInfoBundleTracker.java
示例9: registerModuleInfo
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public ObjectRegistration<YangModuleInfo> registerModuleInfo(final YangModuleInfo yangModuleInfo) {
final ObjectRegistration<YangModuleInfo> yangModuleInfoObjectRegistration = this.moduleInfoRegistry
.registerModuleInfo(yangModuleInfo);
return new ObjectRegistrationWrapper(yangModuleInfoObjectRegistration);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:RefreshingSCPModuleInfoRegistry.java
示例10: ObjectRegistrationWrapper
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
private ObjectRegistrationWrapper(final ObjectRegistration<YangModuleInfo> inner) {
this.inner = inner;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:4,代码来源:RefreshingSCPModuleInfoRegistry.java
示例11: register
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public ObjectRegistration<DOMMountPoint> register() {
Preconditions.checkState(mountPoint == null, "Mount point is already built.");
mountPoint = SimpleDOMMountPoint.create(path, services,schemaContext);
return registerMountPoint(mountPoint);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:DOMMountPointServiceImpl.java
示例12: testSuccessfulCanCommitWithNoopPostStep
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testSuccessfulCanCommitWithNoopPostStep() throws Exception {
final DOMDataTreeCommitCohort cohort = mock(DOMDataTreeCommitCohort.class);
doReturn(PostCanCommitStep.NOOP_SUCCESS_FUTURE).when(cohort).canCommit(any(Object.class),
any(Collection.class), any(SchemaContext.class));
ArgumentCaptor<Collection> candidateCapt = ArgumentCaptor.forClass(Collection.class);
IntegrationTestKit kit = new IntegrationTestKit(getSystem(), datastoreContextBuilder);
try (AbstractDataStore dataStore = kit.setupAbstractDataStore(
DistributedDataStore.class, "testSuccessfulCanCommitWithNoopPostStep", "test-1")) {
final ObjectRegistration<DOMDataTreeCommitCohort> cohortReg = dataStore.registerCommitCohort(TEST_ID,
cohort);
assertNotNull(cohortReg);
IntegrationTestKit.verifyShardState(dataStore, "test-1",
state -> assertEquals("Cohort registrations", 1, state.getCommitCohortActors().size()));
final ContainerNode node = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
kit.testWriteTransaction(dataStore, TestModel.TEST_PATH, node);
verify(cohort).canCommit(any(Object.class),
candidateCapt.capture(), any(SchemaContext.class));
assertDataTreeCandidate((DOMDataTreeCandidate) candidateCapt.getValue().iterator().next(), TEST_ID,
ModificationType.WRITE, Optional.of(node), Optional.absent());
reset(cohort);
doReturn(PostCanCommitStep.NOOP_SUCCESS_FUTURE).when(cohort).canCommit(any(Object.class),
any(Collection.class), any(SchemaContext.class));
kit.testWriteTransaction(dataStore, TestModel.OUTER_LIST_PATH,
ImmutableNodes.mapNodeBuilder(TestModel.OUTER_LIST_QNAME).build());
verify(cohort).canCommit(any(Object.class), any(Collection.class), any(SchemaContext.class));
cohortReg.close();
IntegrationTestKit.verifyShardState(dataStore, "test-1",
state -> assertEquals("Cohort registrations", 0, state.getCommitCohortActors().size()));
kit.testWriteTransaction(dataStore, TestModel.TEST_PATH, node);
verifyNoMoreInteractions(cohort);
}
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:43,代码来源:DataTreeCohortIntegrationTest.java
示例13: addRpcImplementation
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public <T extends RpcService> RpcRegistration<T> addRpcImplementation(final Class<T> type, final T impl)
throws IllegalStateException {
final ObjectRegistration<T> reg = providerAdapter.registerRpcImplementation(type, impl);
return new DelegatedRootRpcRegistration<>(type,reg);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:7,代码来源:HeliumRpcProviderRegistry.java
示例14: DelegatedRootRpcRegistration
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
public DelegatedRootRpcRegistration(final Class<T> type,final ObjectRegistration<T> impl) {
this.delegate = impl;
this.type = type;
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:DelegatedRootRpcRegistration.java
示例15: registerRpcImplementation
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
public <S extends RpcService, T extends S> ObjectRegistration<T> registerRpcImplementation(final Class<S> type,
final T implementation) {
return register(type, implementation, GLOBAL);
}
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:5,代码来源:BindingDOMRpcProviderServiceAdapter.java
示例16: registerConfigurationCommitHandler
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
/**
* Register configuration commit handler for particular subtree
*
* Configuration commit handler is invoked for all write transactions
* which modifies <code>subtree</code>
*
* @param subtree Subtree which configuration commit handler is interested it
* @param commitHandler Instance of user-provided commit handler
* @return Registration object representing this registration. Invoking {@link ObjectRegistration#close()}
* will unregister configuration commit handler.
*/
<C extends AsyncConfigurationCommitCohort<P, D>> ObjectRegistration<C> registerConfigurationCommitHandler(
P subtree, C commitHandler);
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:14,代码来源:AsyncConfigurationCommitCoordinator.java
示例17: register
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
ObjectRegistration<DOMMountPoint> register();
开发者ID:hashsdn,项目名称:hashsdn-controller,代码行数:2,代码来源:DOMMountPointService.java
注:本文中的org.opendaylight.yangtools.concepts.ObjectRegistration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论