/*
* Copyright (C) 2006-2016 DLR, Germany
*
* All rights reserved
*
* http://www.rcenvironment.de/
*/
package de.rcenvironment.core.shutdown;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import de.rcenvironment.core.configuration.bootstrap.BootstrapConfiguration;
/**
* Activator for shutdown.
*
* @author Oliver Seebach
*/
public class Activator implements BundleActivator {
/** */
private static BundleContext context;
static BundleContext getContext() {
return context;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext bundleContext) throws Exception {
HeadlessShutdown shutdown = new HeadlessShutdown();
shutdown.executeByLaunchConfiguration(BootstrapConfiguration.getInstance());
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}