NASA World Wind

gov.nasa.worldwind.retrieve
Class BasicRetrievalService

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.retrieve.BasicRetrievalService
All Implemented Interfaces:
AVList, RetrievalService, WWObject, java.beans.PropertyChangeListener, java.lang.Thread.UncaughtExceptionHandler, java.util.EventListener

public final class BasicRetrievalService
extends WWObjectImpl
implements RetrievalService, java.lang.Thread.UncaughtExceptionHandler

Performs threaded retrieval of data.


Field Summary
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
BasicRetrievalService()
           
 
Method Summary
 boolean contains(Retriever retriever)
           
 int getNumRetrieversPending()
           
 double getProgress()
           
 int getRetrieverPoolSize()
           
 boolean hasActiveTasks()
           
 boolean isAvailable()
           
 RetrievalFuture runRetriever(Retriever retriever)
           
 RetrievalFuture runRetriever(Retriever retriever, double priority)
           
 void setRetrieverPoolSize(int poolSize)
           
 void shutdown(boolean immediately)
           
 void uncaughtException(java.lang.Thread thread, java.lang.Throwable throwable)
           
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Constructor Detail

BasicRetrievalService

public BasicRetrievalService()
Method Detail

contains

public boolean contains(Retriever retriever)
Specified by:
contains in interface RetrievalService
Parameters:
retriever - the retriever to check
Returns:
true if the retriever is being run or pending execution
Throws:
java.lang.IllegalArgumentException - if retriever is null

getNumRetrieversPending

public int getNumRetrieversPending()
Specified by:
getNumRetrieversPending in interface RetrievalService

getProgress

public double getProgress()

getRetrieverPoolSize

public int getRetrieverPoolSize()
Specified by:
getRetrieverPoolSize in interface RetrievalService

hasActiveTasks

public boolean hasActiveTasks()
Specified by:
hasActiveTasks in interface RetrievalService

isAvailable

public boolean isAvailable()
Specified by:
isAvailable in interface RetrievalService

runRetriever

public RetrievalFuture runRetriever(Retriever retriever)
Specified by:
runRetriever in interface RetrievalService
Parameters:
retriever - the retriever to run
Returns:
a future object that can be used to query the request status of cancel the request.
Throws:
java.lang.IllegalArgumentException - if retrieer is null or has no name

runRetriever

public RetrievalFuture runRetriever(Retriever retriever,
                                    double priority)
Specified by:
runRetriever in interface RetrievalService
Parameters:
retriever - the retriever to run
priority - the secondary priority of the retriever, or negative if it is to be the primary priority
Returns:
a future object that can be used to query the request status of cancel the request.
Throws:
java.lang.IllegalArgumentException - if retriever is null or has no name

setRetrieverPoolSize

public void setRetrieverPoolSize(int poolSize)
Specified by:
setRetrieverPoolSize in interface RetrievalService
Parameters:
poolSize - the number of threads in the thread pool
Throws:
java.lang.IllegalArgumentException - if poolSize is non-positive

shutdown

public void shutdown(boolean immediately)
Specified by:
shutdown in interface RetrievalService

uncaughtException

public void uncaughtException(java.lang.Thread thread,
                              java.lang.Throwable throwable)
Specified by:
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandler

NASA World Wind