Created
December 16, 2010 18:36
-
-
Save ckundo/743778 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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