本文整理汇总了Java中org.opendaylight.yangtools.concepts.ObjectRegistration.close方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectRegistration.close方法的具体用法?Java ObjectRegistration.close怎么用?Java ObjectRegistration.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opendaylight.yangtools.concepts.ObjectRegistration
的用法示例。
在下文中一共展示了ObjectRegistration.close方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
}
示例2: 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);
}
}
}
示例3: 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);
}
}
示例4: 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);
}
}