Merge "Removed calling of NeutronRouterAware API from NeutronPortAware"
[groupbasedpolicy.git] / ui-backend / src / main / java / org / opendaylight / controller / config / yang / config / ui_backend / impl / UiBackendModule.java
1 package org.opendaylight.controller.config.yang.config.ui_backend.impl;
2
3 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
4 import org.opendaylight.groupbasedpolicy.ui.backend.UiBackendServiceImpl;
5 import org.slf4j.Logger;
6 import org.slf4j.LoggerFactory;
7
8 import com.google.common.base.Preconditions;
9
10 public class UiBackendModule extends org.opendaylight.controller.config.yang.config.ui_backend.impl.AbstractUiBackendModule {
11
12     private static final Logger LOG = LoggerFactory.getLogger(UiBackendModule.class);
13
14     public UiBackendModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
15         super(identifier, dependencyResolver);
16     }
17
18     public UiBackendModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver, org.opendaylight.controller.config.yang.config.ui_backend.impl.UiBackendModule oldModule, java.lang.AutoCloseable oldInstance) {
19         super(identifier, dependencyResolver, oldModule, oldInstance);
20     }
21
22     @Override
23     public void customValidation() {
24         // add custom validation form module attributes here.
25     }
26
27     @Override
28     public java.lang.AutoCloseable createInstance() {
29         DataBroker dataProvider = Preconditions.checkNotNull(getDataBrokerDependency());
30         final UiBackendServiceImpl pgnApplicationService = new UiBackendServiceImpl(dataProvider,
31                 getRpcRegistryDependency());
32         LOG.info("ui-backend started.");
33
34         return new AutoCloseable() {
35
36             @Override
37             public void close() throws Exception {
38                 pgnApplicationService.close();
39             }
40         };
41     }
42
43 }