2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.config.yang.netconf.topology.shared.schema.repository;
11 import org.opendaylight.netconf.topology.SchemaRepositoryProvider;
12 import org.opendaylight.yangtools.yang.parser.repo.SharedSchemaRepository;
14 public class SchemaRepositoryImplModule extends org.opendaylight.controller.config.yang.netconf.topology.shared.schema.repository.AbstractSchemaRepositoryImplModule {
15 public SchemaRepositoryImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
16 super(identifier, dependencyResolver);
19 public SchemaRepositoryImplModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.netconf.topology.shared.schema.repository.SchemaRepositoryImplModule oldModule, java.lang.AutoCloseable oldInstance) {
20 super(identifier, dependencyResolver, oldModule, oldInstance);
24 public void customValidation() {
25 // add custom validation form module attributes here.
29 public java.lang.AutoCloseable createInstance() {
30 return new SchemaRepositoryProviderAutoCloseAble(this);
33 private static class SchemaRepositoryProviderAutoCloseAble implements SchemaRepositoryProvider, AutoCloseable {
35 private final SharedSchemaRepository schemaRepository;
37 public SchemaRepositoryProviderAutoCloseAble(SchemaRepositoryImplModule module) {
38 schemaRepository = new SharedSchemaRepository(module.getIdentifier().getInstanceName());
42 public void close() throws Exception {
47 public SharedSchemaRepository getSharedSchemaRepository() {
48 return schemaRepository;