Bump versions to 0.20.6-SNAPSHOT
[bgpcep.git] / data-change-counter / src / main / java / org / opendaylight / protocol / data / change / counter / OSGiTopologyDataChangeCounterDeployer.java
1 /*
2  * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.protocol.data.change.counter;
9
10 import org.opendaylight.mdsal.binding.api.DataBroker;
11 import org.osgi.service.component.annotations.Activate;
12 import org.osgi.service.component.annotations.Component;
13 import org.osgi.service.component.annotations.Deactivate;
14 import org.osgi.service.component.annotations.Reference;
15 import org.slf4j.Logger;
16 import org.slf4j.LoggerFactory;
17
18 @Component(immediate = true)
19 public final class OSGiTopologyDataChangeCounterDeployer {
20     private static final Logger LOG = LoggerFactory.getLogger(OSGiTopologyDataChangeCounterDeployer.class);
21
22     @Reference
23     DataBroker dataBroker;
24
25     private TopologyDataChangeCounterDeployer deployer;
26
27     @Activate
28     void activate() {
29         deployer = new TopologyDataChangeCounterDeployer(dataBroker);
30         deployer.register();
31         LOG.info("Topolocy data change counter activated");
32
33     }
34
35     @Deactivate
36     void deactivate() {
37         deployer.close();
38         LOG.info("Topolocy data change counter deactivated");
39     }
40 }