/** * Copyright (c) 2010-2016 by the respective copyright holders. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html */ package org.openhab.binding.sonos.internal; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Extension of the default OSGi bundle activator * * @author Karel Goderis * @since 1.1.0 */ public class SonosActivator implements BundleActivator { private static Logger logger = LoggerFactory.getLogger(SonosActivator.class); 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 { logger.debug("Sonos binding bundle has been started."); SonosActivator.context = bundleContext; } /* * (non-Javadoc) * * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) */ @Override public void stop(BundleContext bundleContext) throws Exception { logger.debug("Sonos binding bundle has been stopped."); SonosActivator.context = null; } }