| package jpos; |
| |
| import org.osgi.framework.BundleActivator; |
| import org.osgi.framework.BundleContext; |
| import org.slf4j.Logger; |
| import org.slf4j.LoggerFactory; |
| |
| public class Activator implements BundleActivator { |
| |
| private static BundleContext context; |
| private static final Logger LOGGER = LoggerFactory.getLogger("activator"); |
| |
| static BundleContext getContext() { |
| return context; |
| } |
| |
| /* |
| * (non-Javadoc) |
| * |
| * @see |
| * org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext |
| * ) |
| */ |
| public void start(BundleContext bundleContext) throws Exception { |
| Activator.context = bundleContext; |
| 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 { |
| Activator.context = null; |
| LOGGER.info(Activator.class.getCanonicalName() + ": stopped"); |
| } |
| |
| } |