Package gov.nasa.worldwind.retrieve
Class BasicRetrievalService
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.retrieve.BasicRetrievalService
-
- All Implemented Interfaces:
AVList,MessageListener,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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface gov.nasa.worldwind.retrieve.RetrievalService
RetrievalService.SSLExceptionListener
-
-
Field Summary
Fields Modifier and Type Field Description protected RetrievalService.SSLExceptionListenersslExceptionListener
-
Constructor Summary
Constructors Constructor Description BasicRetrievalService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Retriever retriever)intgetNumRetrieversPending()doublegetProgress()intgetRetrieverPoolSize()RetrievalService.SSLExceptionListenergetSSLExceptionListener()Indicates the listener to be called whenSSLHandshakeExceptions are thrown during resource retrieval.booleanhasActiveTasks()booleanisAvailable()RetrievalFuturerunRetriever(Retriever retriever)RetrievalFuturerunRetriever(Retriever retriever, double priority)voidsetRetrieverPoolSize(int poolSize)voidsetSSLExceptionListener(RetrievalService.SSLExceptionListener sslExceptionListener)Specifies the listener called when aSSLHandshakeExceptionis thrown during resource retrieval.voidshutdown(boolean immediately)voiduncaughtException(java.lang.Thread thread, java.lang.Throwable throwable)-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, 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 gov.nasa.worldwind.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
sslExceptionListener
protected RetrievalService.SSLExceptionListener sslExceptionListener
-
-
Method Detail
-
getSSLExceptionListener
public RetrievalService.SSLExceptionListener getSSLExceptionListener()
Description copied from interface:RetrievalServiceIndicates the listener to be called whenSSLHandshakeExceptions are thrown during resource retrieval.- Specified by:
getSSLExceptionListenerin interfaceRetrievalService- Returns:
- the exception listener, or null if no listener has been specified.
-
setSSLExceptionListener
public void setSSLExceptionListener(RetrievalService.SSLExceptionListener sslExceptionListener)
Description copied from interface:RetrievalServiceSpecifies the listener called when aSSLHandshakeExceptionis thrown during resource retrieval.- Specified by:
setSSLExceptionListenerin interfaceRetrievalService- Parameters:
sslExceptionListener- to listener to invoke, or null if no listener is to be invoked.
-
uncaughtException
public void uncaughtException(java.lang.Thread thread, java.lang.Throwable throwable)- Specified by:
uncaughtExceptionin interfacejava.lang.Thread.UncaughtExceptionHandler
-
shutdown
public void shutdown(boolean immediately)
- Specified by:
shutdownin interfaceRetrievalService
-
runRetriever
public RetrievalFuture runRetriever(Retriever retriever)
- Specified by:
runRetrieverin interfaceRetrievalService- 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- ifretrieveris null or has no name
-
runRetriever
public RetrievalFuture runRetriever(Retriever retriever, double priority)
- Specified by:
runRetrieverin interfaceRetrievalService- Parameters:
retriever- the retriever to runpriority- 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- ifretrieveris null or has no name
-
setRetrieverPoolSize
public void setRetrieverPoolSize(int poolSize)
- Specified by:
setRetrieverPoolSizein interfaceRetrievalService- Parameters:
poolSize- the number of threads in the thread pool- Throws:
java.lang.IllegalArgumentException- ifpoolSizeis non-positive
-
getRetrieverPoolSize
public int getRetrieverPoolSize()
- Specified by:
getRetrieverPoolSizein interfaceRetrievalService
-
hasActiveTasks
public boolean hasActiveTasks()
- Specified by:
hasActiveTasksin interfaceRetrievalService
-
isAvailable
public boolean isAvailable()
- Specified by:
isAvailablein interfaceRetrievalService
-
getNumRetrieversPending
public int getNumRetrieversPending()
- Specified by:
getNumRetrieversPendingin interfaceRetrievalService
-
contains
public boolean contains(Retriever retriever)
- Specified by:
containsin interfaceRetrievalService- Parameters:
retriever- the retriever to check- Returns:
trueif the retriever is being run or pending execution- Throws:
java.lang.IllegalArgumentException- ifretrieveris null
-
getProgress
public double getProgress()
-
-