Replace LOGGER by LOG
[controller.git] / opendaylight / md-sal / messagebus-impl / src / main / java / org / opendaylight / controller / config / yang / messagebus / app / impl / MessageBusAppImplModule.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.messagebus.app.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.api.DataBroker;
13 import org.opendaylight.controller.messagebus.app.impl.EventSourceTopology;
14 import org.opendaylight.controller.messagebus.app.util.Providers;
15 import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
16 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
17 import org.osgi.framework.BundleContext;
18 import org.slf4j.Logger;
19 import org.slf4j.LoggerFactory;
20
21 public class MessageBusAppImplModule extends org.opendaylight.controller.config.yang.messagebus.app.impl.AbstractMessageBusAppImplModule {
22     private static final Logger LOG = LoggerFactory.getLogger(MessageBusAppImplModule.class);
23
24     private BundleContext bundleContext;
25
26     public BundleContext getBundleContext() {
27         return bundleContext;
28     }
29
30     public void setBundleContext(final BundleContext bundleContext) {
31         this.bundleContext = bundleContext;
32     }
33
34     public MessageBusAppImplModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver) {
35         super(identifier, dependencyResolver);
36     }
37
38     public MessageBusAppImplModule(final ModuleIdentifier identifier, final DependencyResolver dependencyResolver,
39             final MessageBusAppImplModule oldModule, final java.lang.AutoCloseable oldInstance) {
40         super(identifier, dependencyResolver, oldModule, oldInstance);
41     }
42
43     @Override
44     protected void customValidation() {
45     }
46
47     @Override
48     public java.lang.AutoCloseable createInstance() {
49         final ProviderContext bindingCtx = getBindingBrokerDependency().registerProvider(new Providers.BindingAware());
50         final DataBroker dataBroker = bindingCtx.getSALService(DataBroker.class);
51         final RpcProviderRegistry rpcRegistry = bindingCtx.getSALService(RpcProviderRegistry.class);
52         final EventSourceTopology eventSourceTopology = new EventSourceTopology(dataBroker, rpcRegistry);
53         LOG.info("Messagebus initialized");
54         return eventSourceTopology;
55     }
56
57 }