Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.2.0)
E17488-03


oracle.adf.view.rich.model
Class ActiveCollectionModelDecorator

java.lang.Object
  extended by javax.faces.model.DataModel
      extended by org.apache.myfaces.trinidad.model.CollectionModel
          extended by org.apache.myfaces.trinidad.model.CollectionModelDecorator
              extended by oracle.adf.view.rich.model.ActiveCollectionModelDecorator

All Implemented Interfaces:
java.lang.Iterable, ActiveDataModel, org.apache.myfaces.trinidad.model.LocalRowKeyIndex, org.apache.myfaces.trinidad.model.RowKeyIndex

public abstract class ActiveCollectionModelDecorator
extends org.apache.myfaces.trinidad.model.CollectionModelDecorator
implements ActiveDataModel

Users of this class are able to enable active data with the existing data models inside their JSF pages. This class will wrap the existing data model in the page and add additional active data functionality in the decorator itself. Users then replace the binding in the page to point to the decorator Example usage: original page:

<af:table value="#{the.original.collectionModel}"></af:table>

replace with :

<af:table value="#{activeModelDecorator}"></af:table>

where activeModelDecorator is a managed bean subclassing the ActiveCollectionModelDecorator subclasses will look something like this: public class MyDecorator extends ActiveCollectionModelDecorator

{

public CollectionModel getCollectionModel()

{

return _collectionModel;

}

public ActiveDataModel getActiveDataModel()

{

return _activeDataModel;

}

}

See Also:
getActiveDataModel()

Nested Class Summary

 

Nested classes/interfaces inherited from interface oracle.adf.view.rich.model.ActiveDataModel
ActiveDataModel.ActiveDataPolicy

 

Nested classes/interfaces inherited from interface org.apache.myfaces.trinidad.model.LocalRowKeyIndex
org.apache.myfaces.trinidad.model.LocalRowKeyIndex.Confidence, org.apache.myfaces.trinidad.model.LocalRowKeyIndex.LocalCachingStrategy

 

Constructor Summary
ActiveCollectionModelDecorator()
           

 

Method Summary
abstract  ActiveDataModel getActiveDataModel()
          returns the ActiveDataModel implementation
 ActiveDataModel.ActiveDataPolicy getActiveDataPolicy()
          always return ActiveDataPolicy.ACTIVE
 int getCurrentChangeCount()
          Returns the current monotonically increasing change count for this ActiveDataModel This change count is used by the UI components to maintain read consistency between model data fetches and the active data updates.
 void startActiveData(java.util.Collection<java.lang.Object> rowKeys, int startChangeCount, ActiveDataListener listener)
          Called by the DataUpdateManager to notify the ActiveDataModel to start delivering change notifications for the collections of the containers identified by the rowKeys.
 void stopActiveData(java.util.Collection<java.lang.Object> rowKeys, ActiveDataListener listener)
          Called by the DataUpdateManager to notify the ActiveDataModel to stop delivering change notifications for the collections of the container identified by the given rowKeys The rowKeys are for the wrapped collection model by the CollectionModelDecorator

 

Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModelDecorator
addDataModelListener, areRowsAvailable, areRowsAvailable, areRowsAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, areRowsLocallyAvailable, clearCachedRow, clearCachedRow, clearCachedRows, clearCachedRows, clearLocalCache, getCachingStrategy, getCollectionModel, getDataModelListeners, getEstimatedRowCount, getEstimatedRowCountConfidence, getRowCount, getRowData, getRowData, getRowData, getRowIndex, getRowKey, getSortCriteria, getWrappedData, isRowAvailable, isRowAvailable, isRowAvailable, isRowLocallyAvailable, isRowLocallyAvailable, isSortable, removeDataModelListener, setRowIndex, setRowKey, setSortCriteria, setWrappedData

 

Methods inherited from class org.apache.myfaces.trinidad.model.CollectionModel
addRowKeyChangeListener, fireRowKeyChange, removeRowKeyChangeListener

 

Methods inherited from class javax.faces.model.DataModel
iterator

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ActiveCollectionModelDecorator

public ActiveCollectionModelDecorator()

Method Detail

getActiveDataPolicy

public ActiveDataModel.ActiveDataPolicy getActiveDataPolicy()
always return ActiveDataPolicy.ACTIVE
Specified by:
getActiveDataPolicy in interface ActiveDataModel
Returns:
the active data policy
See Also:
ActiveDataModel.ActiveDataPolicy

startActiveData

public void startActiveData(java.util.Collection<java.lang.Object> rowKeys,
                            int startChangeCount,
                            ActiveDataListener listener)
Called by the DataUpdateManager to notify the ActiveDataModel to start delivering change notifications for the collections of the containers identified by the rowKeys. The rowKeys are for the wrapped collection model by the CollectionModelDecorator
Specified by:
startActiveData in interface ActiveDataModel
Parameters:
rowKeys - the container row keys of the collection, from which the ActiveDataListener receives active events. Pass null or empty collection for root collection.
startChangeCount - Change count to start sending active data from.
listener - ActiveDataListener for the ActiceDataModel to use when notifying the DataUpdateManager of changes
Throws:
java.lang.IllegalStateException - if ActiveDataPolicy is STATIC
java.lang.IllegalArgumentException - if listener is null or the startChangeCount is greater than the current change count.
See Also:
stopActiveData(java.util.Collection<java.lang.Object>, oracle.adf.view.rich.event.ActiveDataListener)

stopActiveData

public void stopActiveData(java.util.Collection<java.lang.Object> rowKeys,
                           ActiveDataListener listener)
Called by the DataUpdateManager to notify the ActiveDataModel to stop delivering change notifications for the collections of the container identified by the given rowKeys The rowKeys are for the wrapped collection model by the CollectionModelDecorator
Specified by:
stopActiveData in interface ActiveDataModel
Parameters:
rowKeys - the container row keys of the collections, from which the ActiveDataListener receives active events. Pass null or empty collection for root collection.
listener - the ActiveDataListener to be removed ActiveDataListener receives active events. Pass null for root collection.
Throws:
java.lang.IllegalStateException - If called on an ActiveDataModel that was never started by calling startActiveData
See Also:
startActiveData(java.util.Collection<java.lang.Object>, int, oracle.adf.view.rich.event.ActiveDataListener)

getCurrentChangeCount

public int getCurrentChangeCount()
Returns the current monotonically increasing change count for this ActiveDataModel This change count is used by the UI components to maintain read consistency between model data fetches and the active data updates. Cares need to be taken to assure that larger change count means newer data
Specified by:
getCurrentChangeCount in interface ActiveDataModel
Returns:
The current change count

getActiveDataModel

public abstract ActiveDataModel getActiveDataModel()
returns the ActiveDataModel implementation
Returns:
ActiveDataModel the ActiveDataModel implementation

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle ADF Faces
11g Release 2 (11.1.2.2.0)
E17488-03


Copyright (c) 1998, 2012, Oracle and/or its affiliates. All rights reserved.