Skip to content

Instantly share code, notes, and snippets.

@ckundo
Created December 16, 2010 18:36
Show Gist options
  • Save ckundo/743778 to your computer and use it in GitHub Desktop.
Save ckundo/743778 to your computer and use it in GitHub Desktop.
package earthquake_detector;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
import com.buglabs.bug.accelerometer.pub.IAccelerometerSampleProvider;
import com.buglabs.bug.swarm.connector.pub.ISwarmConnector;
import com.buglabs.application.ServiceTrackerHelper;
public class Activator implements BundleActivator {
private String services[] = new String[] {
ISwarmConnector.class.getName(),
IAccelerometerSampleProvider.class.getName()
};
private ServiceTracker st;
public void start(BundleContext context) throws Exception {
st = ServiceTrackerHelper.openServiceTracker(context, services, new Monitor());
}
public void stop(BundleContext context) throws Exception {
st.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment