org.das2.dataset
Class DataRequestThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.das2.dataset.DataRequestThread
All Implemented Interfaces:
java.lang.Runnable

public class DataRequestThread
extends java.lang.Thread


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
DataRequestThread()
          Creates a new instance of DataRequestThread
 
Method Summary
 void cancelCurrentRequest()
           
 void request(DataSetDescriptor dsd, Datum start, Datum end, Datum resolution, DataRequestor requestor, ProgressMonitor monitor)
          Begins a data reqest operation that will be executed in a separate thread and pass the resulting DataSet to the org.das2.event.DataRequestListener#finished(org.das2.event.DataRequestEvent) finished() method of the DataRequestor specified.
 void requestAndWait(DataSetDescriptor dsd, java.lang.Object params, Datum start, Datum end, Datum resolution, DataRequestor requestor, ProgressMonitor monitor)
          Begins a data reqest operation that will be executed in a separate thread and pass the resulting DataSet to the org.das2.event.DataRequestListener#finished(org.das2.event.DataRequestEvent) finished() method of the DataRequestor specified.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataRequestThread

public DataRequestThread()
Creates a new instance of DataRequestThread

Method Detail

request

public void request(DataSetDescriptor dsd,
                    Datum start,
                    Datum end,
                    Datum resolution,
                    DataRequestor requestor,
                    ProgressMonitor monitor)
             throws java.lang.InterruptedException
Begins a data reqest operation that will be executed in a separate thread and pass the resulting DataSet to the org.das2.event.DataRequestListener#finished(org.das2.event.DataRequestEvent) finished() method of the DataRequestor specified.

Parameters:
dsd - the DataSetDescriptor used to obtain the DataSet
start - the start of the requested time interval
end - the end of the requested time interval
resolution - the requested resolution of the data set
requestor - DataRequestor that is notified when the data loading operation is complete.
Throws:
java.lang.InterruptedException

requestAndWait

public void requestAndWait(DataSetDescriptor dsd,
                           java.lang.Object params,
                           Datum start,
                           Datum end,
                           Datum resolution,
                           DataRequestor requestor,
                           ProgressMonitor monitor)
                    throws java.lang.InterruptedException
Begins a data reqest operation that will be executed in a separate thread and pass the resulting DataSet to the org.das2.event.DataRequestListener#finished(org.das2.event.DataRequestEvent) finished() method of the DataRequestor specified. This method does not return until after the data loading is complete or the request had been canceled.

Parameters:
dsd - the DataSetDescriptor used to obtain the DataSet
params - extra parameters passed to the DataSetDescriptor#getDataSet(org.das2.util.Datum,org.das2.util.Datum,org.das2.util.Datum,org.das2.util.monitor.ProgressMonitor) getDataSet() method. (TODO: these are ignored)
start - the start of the requested time interval
end - the end of the requested time interval
resolution - the requested resolution of the data set
requestor - DataRequestor that is notified when the data loading operation is complete.
Throws:
java.lang.InterruptedException

cancelCurrentRequest

public void cancelCurrentRequest()
                          throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread