- /**
- * Get the schemacontext from loaded modules on classpath.
- *
- * @param moduleInfos a list of Yang module Infos
- * @return SchemaContext a schema context
- */
- private SchemaContext getSchemaContext(List<YangModuleInfo> moduleInfos) {
- this.moduleInfoBackedCntxt.addModuleInfos(moduleInfos);
- Optional<? extends SchemaContext> tryToCreateSchemaContext =
- this.moduleInfoBackedCntxt.tryToCreateSchemaContext();
- if (!tryToCreateSchemaContext.isPresent()) {
- LOG.error("Could not create the initial schema context. Schema context is empty");
- throw new IllegalStateException();
- }
- return tryToCreateSchemaContext.get();
- }
-
- @Override
- public SchemaContext getGlobalContext() {
- return this.schemaContext;
- }
-
- @Override
- public SchemaContext getSessionContext() {
- return this.schemaContext;
- }
-
- @Override
- public ListenerRegistration<SchemaContextListener> registerSchemaContextListener(
- SchemaContextListener listener) {
- return this.listeners.register(listener);
- }