com.im.ijc.widgets/1 5.9.1

com.im.ijc.widgets.common
Class ConcurrentDataProvider

java.lang.Object
  extended by com.im.ijc.widgets.common.ConcurrentDataProvider

public class ConcurrentDataProvider
extends Object

Provides data related to the VertextState for which it is created in efficient manner. Data fetching is usually slow operation and fetching large amount of data eats a lot of memory as well. This class handle the case where multiple clients want to load the same data (whether all data of entity or just data of VertextState) concurrently. See getEntityData() and getVertexStateData() methods.


Nested Class Summary
static class ConcurrentDataProvider.IDsToData
          This class is used as a type alias for two-tuple where first element is list of IDs of fetched data, usually sorted accordingly to the current sort directive of the DFResultSet.VertexState, and second element is data itself as returned by DFResultSet.VertexState.getData(java.util.List>, com.im.commons.progress.DFEnvironmentRO) or DFEntityDataProvider.getData(java.util.List>, com.im.commons.progress.DFEnvironmentRO).
 
Field Summary
static ConcurrentDataProvider EMPTY
           
 
Method Summary
static ConcurrentDataProvider forVertexState(DFResultSet.VertexState vs)
           
 ConcurrentDataProvider.IDsToData getEntityData()
          Returns all data of the entity of the DFResultSet.VertexState for which this instance was created in efficient manner.
 ConcurrentDataProvider.IDsToData getSelectionData()
          Returns selected data of the DFResultSet.VertexState for which this instance was created in efficient manner.
 ConcurrentDataProvider.IDsToData getVertexStateData()
          Returns data of the DFResultSet.VertexState for which this instance was created in efficient manner.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final ConcurrentDataProvider EMPTY
Method Detail

forVertexState

public static ConcurrentDataProvider forVertexState(DFResultSet.VertexState vs)

getEntityData

public ConcurrentDataProvider.IDsToData getEntityData()
Returns all data of the entity of the DFResultSet.VertexState for which this instance was created in efficient manner. If multiple clients request the data at the same time the data are fetched just once and served to all waiting clients when available. After all clients are served the data are discarded.

This methods might take long execution time and eats large amount of memory proportionally to the amount of fetched data.

Returns:
ConcurrentDataProvider.IDsToData instance where IDs are sorted accordingly to the current sort directive of the VertexState. Never null.

getVertexStateData

public ConcurrentDataProvider.IDsToData getVertexStateData()
Returns data of the DFResultSet.VertexState for which this instance was created in efficient manner. If multiple clients request the data at the same time the data are fetched just once and served to all waiting clients when available. After all clients are served the data are discarded.

This methods might take long execution time and eats large amount of memory proportionally to the amount of fetched data.

Returns:
ConcurrentDataProvider.IDsToData instance where IDs are sorted accordingly to the current sort directive of the VertexState. Never null.

getSelectionData

public ConcurrentDataProvider.IDsToData getSelectionData()
Returns selected data of the DFResultSet.VertexState for which this instance was created in efficient manner. If multiple clients request the data at the same time the data are fetched just once and served to all waiting clients when available. After all clients are served the data are discarded.

This methods might take long execution time and eats large amount of memory proportionally to the amount of fetched data.

Returns:
ConcurrentDataProvider.IDsToData instance where IDs are sorted accordingly to the current sort directive of the VertexState. Never null.

com.im.ijc.widgets/1 5.9.1