Integration of Fcaps framework
[vpnservice.git] / fcapsmanager / alarmmanager / src / main / java / org / opendaylight / vpnservice / fcapsmanager / alarmmanager / 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.vpnservice.fcapsmanager.alarmmanager;
9
10 import org.osgi.framework.BundleActivator;
11 import org.osgi.framework.BundleContext;
12 import org.slf4j.Logger;
13 import org.slf4j.LoggerFactory;
14
15 public class Activator implements BundleActivator {
16     static Logger s_logger = LoggerFactory.getLogger(Activator.class);
17     private Runnable listener;
18     private Thread listenerThread;
19
20     public void start(BundleContext context) {
21         s_logger.info("Starting alarmmanager bundle");
22         AlarmNotificationListeners notificationListeners = new AlarmNotificationListeners(context);
23         try {
24             listener = notificationListeners;
25             listenerThread = new Thread(listener);
26             listenerThread.start();
27         } catch (Exception e) {
28             s_logger.error("Exception in alarm thread {}", e);
29         }
30     }
31
32     public void stop(BundleContext context) {
33         s_logger.info("Stopping alarmmanager bundle");
34     }
35 }