public class RemoteTileFetcher extends android.os.HandlerThread implements TileFetcher
Modifier and Type | Class and Description |
---|---|
class |
RemoteTileFetcher.Stats
Stats collected by the fetcher
|
class |
RemoteTileFetcher.TileInfo
A single tile that we're supposed to be loading.
|
Modifier and Type | Field and Description |
---|---|
protected RemoteTileFetcher.Stats |
allStats |
boolean |
debugMode
Set this to get way too much debugging output.
|
protected RemoteTileFetcher.Stats |
recentStats |
protected boolean |
valid |
Modifier and Type | Method and Description |
---|---|
void |
cancelTileFetches(java.lang.Object[] fetchRequests)
Cancel a group of requests at once
Use the object returned by the startTileFetch call (which is just a Request object)
|
protected void |
finishedLoading(RemoteTileFetcher.TileInfo inTile,
okhttp3.Response response,
java.lang.Exception inE,
double fetchStartTile) |
protected void |
finishTile(RemoteTileFetcher.TileInfo inTile) |
java.lang.String |
getFetcherName()
Name of this tile fetcher.
|
RemoteTileFetcher.Stats |
getStats(boolean allTime)
Return the stats (recent or for all time
|
protected void |
handleCache(RemoteTileFetcher.TileInfo tile) |
protected void |
handleFinishLoading(RemoteTileFetcher.TileInfo inTile,
byte[] data,
java.lang.Exception error) |
void |
resetActiveStats()
Reset the periodic active stats.
|
void |
resetStats()
Reset the stats keeping back to zero
|
protected void |
scheduleLoading() |
void |
shutdown()
Kill all outstanding connections and clean up.
|
protected void |
startFetch(RemoteTileFetcher.TileInfo tile) |
void |
startTileFetches(TileFetchRequest[] requests)
Add a whole group of requests at once.
|
void |
updateActiveStats() |
protected void |
updateLoading() |
java.lang.Object |
updateTileFetch(java.lang.Object fetchRequest,
int priority,
float importance)
Update an active request with a new priority and importance.
|
protected void |
writeToCache(RemoteTileFetcher.TileInfo tile,
byte[] data) |
getLooper, getThreadId, onLooperPrepared, quit, quitSafely, run
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected boolean valid
public boolean debugMode
protected RemoteTileFetcher.Stats allStats
protected RemoteTileFetcher.Stats recentStats
public java.lang.String getFetcherName()
getFetcherName
in interface TileFetcher
public RemoteTileFetcher.Stats getStats(boolean allTime)
public void resetStats()
public void resetActiveStats()
public void updateActiveStats()
public void startTileFetches(TileFetchRequest[] requests)
startTileFetches
in interface TileFetcher
protected void scheduleLoading()
protected void updateLoading()
protected void startFetch(RemoteTileFetcher.TileInfo tile)
protected void finishedLoading(RemoteTileFetcher.TileInfo inTile, okhttp3.Response response, java.lang.Exception inE, double fetchStartTile)
protected void handleCache(RemoteTileFetcher.TileInfo tile)
protected void handleFinishLoading(RemoteTileFetcher.TileInfo inTile, byte[] data, java.lang.Exception error)
protected void writeToCache(RemoteTileFetcher.TileInfo tile, byte[] data)
protected void finishTile(RemoteTileFetcher.TileInfo inTile)
public java.lang.Object updateTileFetch(java.lang.Object fetchRequest, int priority, float importance)
updateTileFetch
in interface TileFetcher
public void cancelTileFetches(java.lang.Object[] fetchRequests)
cancelTileFetches
in interface TileFetcher
public void shutdown()
shutdown
in interface TileFetcher