org.opensubsystems.patterns.listdata.util
Interface AsyncDataLoaderOwner


public interface AsyncDataLoaderOwner

This interface should be implemented by the class which uses AsyncDataLoader to load items in the background.

Version:
$Id: AsyncDataLoaderOwner.java,v 1.2 2007/01/07 06:14:15 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Method Summary
 void allDataLoaded(AsyncDataLoader loader)
          This function is called where data loading finished.
 ListOptions getInitialListOptions(AsyncDataLoader loader, ListOptions defaultOptions)
          Get the initial ListOptions structure used to load the list of data objects.
 void processData(AsyncDataLoader loader, java.util.List lstDataToAdd, int iOriginalObjectVersion)
          Process data which were asynchronously loaded.
 boolean stopLoading(AsyncDataLoader loader)
          This method should return true if the async thread should stop loading data.
 

Method Detail

getInitialListOptions

ListOptions getInitialListOptions(AsyncDataLoader loader,
                                  ListOptions defaultOptions)
Get the initial ListOptions structure used to load the list of data objects. This method may be modify the default listoptions passed in if some parameters should be preset.

Parameters:
loader - - loader invoking this call
defaultOptions - - default options which can be modified or replaced with new initial options
Returns:
ListOptions - initialized list options

stopLoading

boolean stopLoading(AsyncDataLoader loader)
This method should return true if the async thread should stop loading data. It can be for example implemented in such a way that the owner stores the reference to the latest asynchronous loader constructed. If some previous constructed loader is still running and calls this method, it will compare it with the cached value and return true if they are not equal.

Parameters:
loader - - loader invoking this call
Returns:
boolean - true if the async thread should stop loading data, false to continue loading

processData

void processData(AsyncDataLoader loader,
                 java.util.List lstDataToAdd,
                 int iOriginalObjectVersion)
Process data which were asynchronously loaded.

Parameters:
loader - - loader invoking this call
lstDataToAdd - - list of data items to add to the container
iOriginalObjectVersion - - version of the object by which the data should be processed, which is the version which was used to construct this object. If the version of the object at the time when the data are being processed is different from this version, then the data will not be processed or the processing of the data stops.

allDataLoaded

void allDataLoaded(AsyncDataLoader loader)
This function is called where data loading finished. It is useful if you want do same changes or ask for information relevant to the whole dataset.

Parameters:
loader - - loader invoking this call


Copyright © 2003 - 2006 OpenSubsystems s.r.o.