本文整理汇总了Java中org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory类的典型用法代码示例。如果您正苦于以下问题:Java BindingCodecTreeFactory类的具体用法?Java BindingCodecTreeFactory怎么用?Java BindingCodecTreeFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BindingCodecTreeFactory类属于org.opendaylight.mdsal.binding.dom.codec.api包,在下文中一共展示了BindingCodecTreeFactory类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BmpDeployerDependencies
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
public BmpDeployerDependencies(final DataBroker dataBroker, final DOMDataBroker domDataBroker,
final RIBExtensionConsumerContext extensions, final BindingCodecTreeFactory codecTreeFactory,
final SchemaContext schemaContext, final ClusterSingletonServiceProvider singletonProvider) {
this.dataBroker = requireNonNull(dataBroker);
this.domDataBroker = requireNonNull(domDataBroker);
this.extensions = requireNonNull(extensions);
this.tree = requireNonNull(codecTreeFactory).create(schemaContext);
this.singletonProvider = requireNonNull(singletonProvider);
}
示例2: RIBImpl
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
public RIBImpl(final RibId ribId, final AsNumber localAs, final BgpId localBgpId,
final ClusterIdentifier clusterId, final RIBExtensionConsumerContext extensions, final BGPDispatcher dispatcher,
final BindingCodecTreeFactory codecFactory, final DOMDataBroker domDataBroker, final List<BgpTableType> localTables,
@Nonnull final Map<TablesKey, PathSelectionMode> bestPathSelectionStrategies, final GeneratedClassLoadingStrategy classStrategy) {
super(InstanceIdentifier.create(BgpRib.class).child(Rib.class, new RibKey(requireNonNull(ribId))),
localBgpId, localAs);
this.localAs = requireNonNull(localAs);
this.bgpIdentifier = requireNonNull(localBgpId);
this.dispatcher = requireNonNull(dispatcher);
this.localTables = ImmutableSet.copyOf(localTables);
this.localTablesKeys = new HashSet<>();
this.domDataBroker = requireNonNull(domDataBroker);
this.service = this.domDataBroker.getSupportedExtensions().get(DOMDataTreeChangeService.class);
this.extensions = requireNonNull(extensions);
this.codecsRegistry = CodecsRegistryImpl.create(codecFactory, classStrategy);
this.ribContextRegistry = RIBSupportContextRegistryImpl.create(extensions, this.codecsRegistry);
final InstanceIdentifierBuilder yangRibIdBuilder = YangInstanceIdentifier.builder().node(BgpRib.QNAME).node(Rib.QNAME);
this.yangRibId = yangRibIdBuilder.nodeWithKey(Rib.QNAME, RIB_ID_QNAME, ribId.getValue()).build();
this.bestPathSelectionStrategies = requireNonNull(bestPathSelectionStrategies);
final ClusterIdentifier cId = clusterId == null ? new ClusterIdentifier(localBgpId) : clusterId;
this.ribId = ribId;
final PolicyDatabase policyDatabase = new PolicyDatabase(this.localAs.getValue(), localBgpId, cId);
this.importPolicyPeerTracker = new ImportPolicyPeerTrackerImpl(policyDatabase);
final ImmutableMap.Builder<TablesKey, ExportPolicyPeerTracker> exportPolicies = new ImmutableMap.Builder<>();
for (final BgpTableType t : this.localTables) {
final TablesKey key = new TablesKey(t.getAfi(), t.getSafi());
this.localTablesKeys.add(key);
exportPolicies.put(key, new ExportPolicyPeerTrackerImpl(policyDatabase, key));
}
this.exportPolicyPeerTrackerMap = exportPolicies.build();
}
示例3: RibImpl
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
public RibImpl(final RIBExtensionConsumerContext contextProvider, final BGPDispatcher dispatcher,
final BindingCodecTreeFactory codecTreeFactory, final DOMDataBroker domBroker,
final DOMSchemaService domSchemaService) {
this.extensions = contextProvider;
this.dispatcher = dispatcher;
this.codecTreeFactory = codecTreeFactory;
this.domBroker = domBroker;
this.domSchemaService = domSchemaService;
}
示例4: createCodecFactory
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
private static BindingCodecTreeFactory createCodecFactory(final ClassLoadingStrategy str, final SchemaContext ctx) {
final DataObjectSerializerGenerator generator = StreamWriterGenerator
.create(JavassistUtils.forClassPool(ClassPool.getDefault()));
final BindingNormalizedNodeCodecRegistry codec = new BindingNormalizedNodeCodecRegistry(generator);
codec.onBindingRuntimeContextUpdated(BindingRuntimeContext.create(str, ctx));
return codec;
}
示例5: CodecsRegistryImpl
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
private CodecsRegistryImpl(final BindingCodecTreeFactory codecFactory, final GeneratedClassLoadingStrategy strategy) {
this.codecFactory = requireNonNull(codecFactory);
this.classContext = requireNonNull(strategy);
}
示例6: create
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
static CodecsRegistryImpl create(final BindingCodecTreeFactory codecFactory, final GeneratedClassLoadingStrategy classStrategy) {
return new CodecsRegistryImpl(codecFactory, classStrategy);
}
示例7: setUp
import org.opendaylight.mdsal.binding.dom.codec.api.BindingCodecTreeFactory; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
final DOMDataBroker domDataBroker = mock(DOMDataBroker.class);
doReturn(this.wTx).when(this.dataBroker).newWriteOnlyTransaction();
doReturn("mapping").when(this.tableTypeRegistry).toString();
doReturn(null).when(domDataBroker).createTransactionChain(any());
doReturn(Collections.singletonMap(DOMDataTreeChangeService.class, mock(DOMDataBrokerExtension.class)))
.when(domDataBroker).getSupportedExtensions();
doReturn(Optional.of(TABLE_TYPE)).when(this.tableTypeRegistry).getTableType(any());
doReturn(Optional.of(TABLES_KEY)).when(this.tableTypeRegistry).getTableKey(any());
Mockito.doNothing().when(this.registration).unregister();
doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.RIB.getServices()), any()
, any(Dictionary.class));
doReturn(this.registration).when(this.bundleContext).registerService(eq(InstanceType.PEER.getServices()), any()
, any(Dictionary.class));
Mockito.doNothing().when(this.wTx).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class),
any(NetworkInstance.class));
final CheckedFuture<?, ?> future = mock(CheckedFuture.class);
doReturn(future).when(this.wTx).submit();
Mockito.doNothing().when(future).addListener(any(), any());
doReturn(this.dataTreeRegistration).when(this.dataBroker).registerDataTreeChangeListener(any(), any());
Mockito.doNothing().when(this.dataTreeRegistration).close();
final InstanceIdentifier<Bgp> bgpIID = InstanceIdentifier.create(NetworkInstances.class)
.child(NetworkInstance.class, new NetworkInstanceKey(NETWORK_INSTANCE_NAME)).child(Protocols.class)
.child(Protocol.class, new ProtocolKey(BGP.class, "bgp"))
.augmentation(Protocol1.class).child(Bgp.class);
doReturn(new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, bgpIID))
.when(this.modification).getRootPath();
doReturn(this.dObject).when(this.modification).getRootNode();
doReturn("bgpPeer").when(this.modification).toString();
doReturn(Collections.singleton(this.dObject)).when(this.dObject).getModifiedChildren();
doReturn("dObject").when(this.dObject).toString();
final RIBExtensionConsumerContext extension = mock(RIBExtensionConsumerContext.class);
doReturn(mock(GeneratedClassLoadingStrategy.class)).when(extension).getClassLoadingStrategy();
final ClusterSingletonServiceRegistration serviceRegistration = mock(ClusterSingletonServiceRegistration.class);
doReturn(serviceRegistration).when(this.singletonServiceProvider).registerClusterSingletonService(any());
Mockito.doNothing().when(serviceRegistration).close();
final DOMSchemaService schemaService = mock(DOMSchemaService.class);
Mockito.doNothing().when(this.dataTreeRegistration).close();
doReturn(this.dataTreeRegistration).when(schemaService).registerSchemaContextListener(any());
final RibImpl ribImpl = new RibImpl(extension, mock(BGPDispatcher.class), mock(BindingCodecTreeFactory.class),
domDataBroker, schemaService);
doReturn(ribImpl).when(this.blueprintContainer).getComponentInstance(eq("ribImpl"));
final BgpPeer bgpPeer = new BgpPeer(mock(RpcProviderRegistry.class));
doReturn(bgpPeer).when(this.blueprintContainer).getComponentInstance(eq("bgpPeer"));
this.collection = Collections.singleton(this.modification);
}