use of org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext in project lighty-netconf-simulator by PANTHEONtech.
the class NetconfDeviceServicesImpl method createAdapterContext.
private AdapterContext createAdapterContext(Collection<YangModuleInfo> moduleInfos) {
final YangParserFactory yangParserFactory = new DefaultYangParserFactory();
ModuleInfoSnapshotResolver snapshotResolver = new ModuleInfoSnapshotResolver("netconf-simulator", yangParserFactory);
snapshotResolver.registerModuleInfos(moduleInfos);
ModuleInfoSnapshot moduleInfoSnapshot = snapshotResolver.takeSnapshot();
final BindingRuntimeGenerator bindingRuntimeGenerator = new DefaultBindingRuntimeGenerator();
final BindingRuntimeTypes bindingRuntimeTypes = bindingRuntimeGenerator.generateTypeMapping(moduleInfoSnapshot.getEffectiveModelContext());
final DefaultBindingRuntimeContext bindingRuntimeContext = new DefaultBindingRuntimeContext(bindingRuntimeTypes, moduleInfoSnapshot);
final BindingCodecContext bindingCodecContext = new BindingCodecContext(bindingRuntimeContext);
return new ConstantAdapterContext(bindingCodecContext);
}
use of org.opendaylight.mdsal.binding.dom.adapter.ConstantAdapterContext in project lighty-netconf-simulator by PANTHEONtech.
the class NetworkTopologyServiceAbstractProcessor method init.
@Override
public void init(final NetconfDeviceServices netconfDeviceServices) {
super.init(netconfDeviceServices);
final ConstantAdapterContext constantAdapterContext = new ConstantAdapterContext(netconfDeviceServices.getAdapterContext().currentSerializer());
this.adapterSerializer = constantAdapterContext.currentSerializer();
}
Aggregations