| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * 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/ |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.osgi.hybrid.api; |
| |
| import org.eclipse.core.runtime.Plugin; |
| import org.eclipse.osbp.gitinfo.Loginfo; |
| import org.osgi.framework.BundleActivator; |
| import org.osgi.framework.BundleContext; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| |
| public class Activator extends Plugin implements BundleActivator { |
| |
| private static BundleContext context; |
| private static final Logger LOGGER = LoggerFactory.getLogger("activator"); |
| |
| public static BundleContext getContext() { |
| return context; |
| } |
| |
| /* |
| * (non-Javadoc) |
| * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext) |
| */ |
| public void start(BundleContext bundleContext) throws Exception { |
| super.start(bundleContext); |
| Activator.context = bundleContext; |
| Loginfo li = new Loginfo(); |
| li.print( Activator.class.getCanonicalName(), Activator.class.getClassLoader()); |
| LOGGER.info(Activator.class.getCanonicalName()+": started"); |
| } |
| |
| /* |
| * (non-Javadoc) |
| * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) |
| */ |
| public void stop(BundleContext bundleContext) throws Exception { |
| super.stop(bundleContext); |
| Activator.context = null; |
| LOGGER.info(Activator.class.getCanonicalName()+": stopped"); |
| } |
| |
| } |