package uk.ac.diamond.scisoft.analysis.processing.actor;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
public class Activator implements BundleActivator {
private static BundleContext context;
@Override
public void start(BundleContext c) throws Exception {
context = c;
}
@Override
public void stop(BundleContext c) throws Exception {
context = null;
}
public static Object getService(Class<?> clazz) {
if (context==null) return null;
ServiceReference<?> ref = context.getServiceReference(clazz);
if (ref==null) return null;
return context.getService(ref);
}
}