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 ActiveScalarModelDecorator

java.lang.Object
  extended by oracle.adf.view.rich.model.ActiveScalarModelDecorator

All Implemented Interfaces:
ActiveDataModel

public abstract class ActiveScalarModelDecorator
extends java.lang.Object
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:outputText value="#{the.original.bean.field}" id="ot4"/>

replace with :

<af:activeOutputText value="#{viewScope.ScalarModelDecorator.value}" />

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

{

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

 

Constructor Summary
ActiveScalarModelDecorator()
           

 

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.
protected abstract  java.lang.Object getDecoratedValue()
          this returns the originalModel's original field value
 java.lang.Object getValue()
          get the value for this scalar model.
protected abstract  void setValue(java.lang.Object value)
          this sets the original field value
 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 not used for scalar active data model

 

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

 

Constructor Detail

ActiveScalarModelDecorator

public ActiveScalarModelDecorator()

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

getValue

public final java.lang.Object getValue()
get the value for this scalar model. In here we register the active data attributes
Returns:
the original value

getDecoratedValue

protected abstract java.lang.Object getDecoratedValue()
this returns the originalModel's original field value
Returns:
the original value

setValue

protected abstract void setValue(java.lang.Object value)
this sets the original field value
Parameters:
value - the value to be set

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 not used in the scalar model case.
Specified by:
startActiveData in interface ActiveDataModel
Parameters:
rowKeys - not used
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 not used for scalar active data model
Specified by:
stopActiveData in interface ActiveDataModel
Parameters:
rowKeys - not used
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.