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
8 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
10 import org.opendaylight.controller.config.api.DependencyResolver;
11 import org.opendaylight.controller.config.api.ModuleIdentifier;
12 import org.opendaylight.controller.md.sal.binding.impl.BindingToNormalizedNodeCodec;
13 import org.opendaylight.controller.md.sal.binding.impl.ForwardedNotificationService;
14 import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService;
15 import org.opendaylight.controller.sal.binding.codegen.impl.SingletonHolder;
16 import org.opendaylight.controller.sal.core.api.Broker;
18 public class BindingNotificationAdapterModule extends AbstractBindingNotificationAdapterModule {
19 public BindingNotificationAdapterModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
20 super(identifier, dependencyResolver);
23 public BindingNotificationAdapterModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.md.sal.binding.impl.BindingNotificationAdapterModule oldModule, java.lang.AutoCloseable oldInstance) {
24 super(identifier, dependencyResolver, oldModule, oldInstance);
28 public void customValidation() {
29 // add custom validation form module attributes here.
33 public java.lang.AutoCloseable createInstance() {
34 final BindingToNormalizedNodeCodec codec = getBindingMappingServiceDependency();
35 final Broker.ProviderSession session = getDomAsyncBrokerDependency().registerProvider(new DummyDOMProvider());
36 final DOMNotificationService notifService = session.getService(DOMNotificationService.class);
37 return new ForwardedNotificationService(codec.getCodecRegistry(), notifService, SingletonHolder.INVOKER_FACTORY);