Merge "BUG 2854 : Do not add empty read write transactions to the replicable journal"
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / config / yang / md / sal / binding / impl / BindingNotificationAdapterModule.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.yang.md.sal.binding.impl;
9
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.BindingDOMNotificationServiceAdapter;
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;
17
18 public class BindingNotificationAdapterModule extends AbstractBindingNotificationAdapterModule  {
19     public BindingNotificationAdapterModule(ModuleIdentifier identifier, DependencyResolver dependencyResolver) {
20         super(identifier, dependencyResolver);
21     }
22
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);
25     }
26
27     @Override
28     public void customValidation() {
29         // add custom validation form module attributes here.
30     }
31
32     @Override
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 BindingDOMNotificationServiceAdapter(codec.getCodecRegistry(), notifService, SingletonHolder.INVOKER_FACTORY);
38     }
39
40 }