本文整理汇总了Java中org.opendaylight.yangtools.concepts.ObjectRegistration类的典型用法代码示例。如果您正苦于以下问题:Java ObjectRegistration类的具体用法?Java ObjectRegistration怎么用?Java ObjectRegistration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectRegistration类属于org.opendaylight.yangtools.concepts包,在下文中一共展示了ObjectRegistration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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");
}
示例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);
}
}
}
示例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();
}
示例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);
}
示例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);
}
}
}
示例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);
}
}
示例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);
}
示例8: modifiedBundle
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
@Override
public void modifiedBundle(final Bundle bundle, final BundleEvent event,
final Collection<ObjectRegistration<YangModuleInfo>> object) {
}
示例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);
}
示例10: ObjectRegistrationWrapper
import org.opendaylight.yangtools.concepts.ObjectRegistration; //导入依赖的package包/类
private ObjectRegistrationWrapper(final ObjectRegistration<YangModuleInfo> inner) {
this.inner = inner;
}
示例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);
}
示例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);
}
}
示例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);
}
示例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;
}
示例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);
}