use the right hop for more than one sf
[netvirt.git] / vpnservice / fcapsmanager / countermanager / src / main / java / org / opendaylight / netvirt / fcapsmanager / countermanager / Activator.java
1 /*
2  * Copyright (c) 2016 Ericsson India Global Services Pvt Ltd. 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.netvirt.fcapsmanager.countermanager;
9
10 import org.osgi.framework.BundleActivator;
11 import org.osgi.framework.BundleContext;
12 import org.slf4j.LoggerFactory;
13
14 import javax.management.InstanceNotFoundException;
15 import javax.management.MBeanException;
16 import javax.management.MalformedObjectNameException;
17 import javax.management.ReflectionException;
18 import java.io.IOException;
19
20 public class Activator implements BundleActivator {
21     private final static org.slf4j.Logger LOG = LoggerFactory.getLogger(Activator.class);
22     private Runnable listener;
23     private Thread listenerThread;
24
25     public void start(BundleContext context) throws InstanceNotFoundException, MalformedObjectNameException, MBeanException, ReflectionException, IOException {
26         LOG.info("Starting countermanager bundle ");
27         PMRegistrationListener notificationListeners = new PMRegistrationListener(context);
28         try {
29             listener = notificationListeners;
30             listenerThread = new Thread(listener);
31             listenerThread.start();
32         } catch (Exception e) {
33             LOG.error("Exception in counter thread {}", e);
34         }
35     }
36
37     public void stop(BundleContext context) {
38         LOG.info("Stopping countermanager bundle ");
39     }
40 }