blob: abc89f39042aff84a83043eae8f414a4dfb068ff [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2014, 2016 Orange.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*******************************************************************************/
package org.eclipse.om2m.ipe.sample.sdt;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.eclipse.om2m.ipe.sample.sdt.controller.LifeCycleManager;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
/**
* Manages the starting and stopping of the bundle.
*/
public class Activator implements BundleActivator {
/** Logger */
private static Log logger = LogFactory.getLog(Activator.class);
@Override
public void start(final BundleContext bundleContext) throws Exception {
new Thread() {
public void run() {
try {
LifeCycleManager.start(bundleContext);
} catch (Exception e) {
logger.error("IpeMonitor Sample error", e);
}
}
}.start();
}
@Override
public void stop(BundleContext bundleContext) throws Exception {
logger.info("Stop Ipe Sample");
try {
LifeCycleManager.stop();
} catch (Exception e) {
logger.error("Stop IPE Sample error", e);
}
}
}