|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.placelab.spotter.AbstractSpotter
org.placelab.spotter.SyncSpotter
This convenience class provides the groundwork for Spotters whose
implementations are most naturally synchronous. An example of such
a Spotter is WiFiSpotter. Subclasses provide their own
blocking getMeasurementImpl and the SyncSpotter uses that to offer
up the asynchronous spotter interface for users of the Spotter.
| Constructor Summary | |
SyncSpotter()
|
|
| Method Summary | |
void |
errorInBackgroundThreadAndThreadDeath(java.lang.Throwable t)
|
Measurement |
getMeasurement()
A blocking call to get a new Measurement. |
protected abstract Measurement |
getMeasurementImpl()
Collects and returns a single Measurement. |
protected abstract long |
nextScanInterval()
|
protected void |
scanUsingBackgroundThread(EventSystem evs)
|
protected void |
scanUsingEventSystem(EventSystem evs)
|
void |
startScanning()
Start scanning for Measurements in the background and return the Measurements by notifying SpotterListeners with the SpotterListener.gotMeasurement(Spotter, Measurement) method. |
void |
startScanning(EventSystem evs)
Start scanning for Measurements. |
void |
stopScanning()
Stops a currently running background scan started from either scanOnce or startScanning. |
| Methods inherited from class org.placelab.spotter.AbstractSpotter |
addListener, notifyEndOfScan, notifyEndOfScan, notifyGotException, notifyGotException, notifyGotMeasurement, notifyGotMeasurement, removeListener, scanOnce, scanOnce, waitForThread |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.placelab.spotter.Spotter |
close, open |
| Constructor Detail |
public SyncSpotter()
| Method Detail |
protected abstract long nextScanInterval()
protected abstract Measurement getMeasurementImpl()
throws SpotterException
SpotterException
public Measurement getMeasurement()
throws SpotterException
Spotter
SpotterExceptionpublic void startScanning()
SpotterSpotterListener.gotMeasurement(Spotter, Measurement) method.
Depending on the Spotter implementation this
may start up a new background thread. Callbacks to the SpotterListener are
not guaranteed to (and probably won't) be in the the same thread as
startScanning was called in.
startScanning in interface SpotterstartScanning in class AbstractSpotterpublic void startScanning(EventSystem evs)
Spotter
startScanning in interface SpotterstartScanning in class AbstractSpotterpublic void stopScanning()
Spotter
stopScanning in interface SpotterstopScanning in class AbstractSpotterprotected void scanUsingBackgroundThread(EventSystem evs)
protected void scanUsingEventSystem(EventSystem evs)
public void errorInBackgroundThreadAndThreadDeath(java.lang.Throwable t)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||