Class BalloonController.DocumentRetrievalTask
- java.lang.Object
- 
- java.util.TimerTask
- 
- gov.nasa.worldwindx.examples.util.BalloonController.DocumentRetrievalTask
 
 
- 
- All Implemented Interfaces:
- java.lang.Runnable
 - Enclosing class:
- BalloonController
 
 protected class BalloonController.DocumentRetrievalTask extends java.util.TimerTaskA TimerTask that will request a resource from theFileStoreuntil it becomes available, or until a timeout is exceeded. When the task finishes it will trigger a callback on the Event Dispatch Thread (EDT) to eitheronDocumentLoadedoronDocumentFailed.This task is designed to be repeated periodically. The task will cancel itself when the document becomes available, or the timeout is exceeded. 
- 
- 
Field SummaryFields Modifier and Type Field Description protected KMLRootcontextThe document that contained the link this document.protected java.lang.StringdocUrlURL of the KML document to load.protected java.lang.StringfeatureRefReference to a feature in the remote document, with an action (for example, "myFeature;flyto").protected longstartTime that the task started, used to evaluate the timeout.protected longtimeoutTask timeout.
 - 
Constructor SummaryConstructors Constructor Description DocumentRetrievalTask(java.lang.String url, KMLRoot context, java.lang.String featureRef, long timeout)Create a new retrieval task.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidrun()Request the document from theFileStore.
 
- 
- 
- 
Field Detail- 
docUrlprotected java.lang.String docUrl URL of the KML document to load.
 - 
contextprotected KMLRoot context The document that contained the link this document.
 - 
featureRefprotected java.lang.String featureRef Reference to a feature in the remote document, with an action (for example, "myFeature;flyto"). The action will be carried out when the document becomes available.
 - 
timeoutprotected long timeout Task timeout. If the document has not been loaded after this many milliseconds, the task will cancel itself and report an error.
 - 
startprotected long start Time that the task started, used to evaluate the timeout.
 
- 
 - 
Constructor Detail- 
DocumentRetrievalTaskpublic DocumentRetrievalTask(java.lang.String url, KMLRoot context, java.lang.String featureRef, long timeout)Create a new retrieval task.- Parameters:
- url- URL of document to retrieve.
- context- Context of the link to the document. May be null.
- featureRef- Reference to a feature in the remote document, with an action to perform on the feature (for example, "myFeature;flyto"). The action will be carried out when the document becomes available.
- timeout- Timeout for this task in milliseconds. The task will fail if the document has not been downloaded in this many milliseconds.
 
 
- 
 - 
Method Detail- 
runpublic void run() Request the document from theFileStore. If the document is available, parse it and schedule a callback on the EDT toBalloonController.onDocumentLoaded(String, gov.nasa.worldwind.ogc.kml.KMLRoot, String). If an exception occurs, or the timeout is exceeded, schedule a callback on the EDT toBalloonController.onDocumentFailed(String, Exception)- Specified by:
- runin interface- java.lang.Runnable
- Specified by:
- runin class- java.util.TimerTask
 
 
- 
 
-