Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.6.0)

E10653-07

oracle.adf.model.dcframe
Class DataControlFrameImpl

java.lang.Object
  extended by oracle.adf.model.dcframe.DataControlFrameImpl
All Implemented Interfaces:
DataControlFrame

public class DataControlFrameImpl
extends java.lang.Object
implements DataControlFrame

Since:
11.1.0

Constructor Summary
DataControlFrameImpl(java.lang.String name, DataControlFrameImpl parentFrame, java.util.List<DataControlPolicy> policies, DataControlPolicy defaultPolicy, BindingContext bindingContext)
          Constructor
 
Method Summary
 void addDataControl(java.lang.Object key, DCDataControl dc)
          Add an datacontrol to the list of datacontrols that this datacontrol frame should maintain.
 boolean addDataControlPolicy(DataControlPolicy policy)
          Adds a datacontrol policy to this datacontrol frame.
 void beginRequest(BindingContext bindingCtx, java.util.HashMap requestCtx)
           
 void beginTransaction(TransactionProperties properties)
          Begin a new transaction.
 void commit()
          Commit the current underlying transaction.
 boolean containsBindingContainer(java.lang.Object bc)
           
 boolean containsDataControl(java.lang.Object dc)
           
 SavepointHandle createSavepoint()
          Create a savepoint marking the current state of the task flow context.
 java.io.Serializable createSnapshot()
          Creates a snapshot of the states of the DataControls in the frame.
 java.util.Collection<DCDataControl> datacontrols()
          Returns the set of data controls in the frame
 void endRequest(BindingContext bindingCtx, java.util.HashMap requestCtx)
           
 DCDataControl findDataControl(java.lang.String dcName)
          Retrieve a datacontrol instance with the given name from this datacontrol frame.
 DCDataControl findDataControl(java.lang.String dcName, boolean create)
           
 DCDataControl findDataControl(java.lang.String dcUsageName, java.lang.String dcName, boolean create)
           
 DataControlPolicy findPolicy(java.lang.String name)
          Retrieve a datacontrol policy with the given name from this datacontrol frame.
 java.lang.String findUniqueKey(java.lang.String key, java.util.Map dcMap)
          Return a key that is unique among the keys for datacontrols in the BindingContext.
 DCBindingContainer getBindingContainer(java.lang.Object key)
           
 java.util.Collection<DCBindingContainer> getBindingContainers()
           
 DataControlPolicy getDefaultPolicy()
          Return the default datacontrol policy of this datacontrol frame.
 java.lang.String getName()
           
 java.lang.String getOpenTransactionName()
          Returns the name of the transaction if a transaction is open in this datacontrol frame.
 java.util.concurrent.locks.ReentrantLock getSyncLock()
           
 boolean isTransactionDirty()
          Indicates if unsaved data modifications exists within the current datacontrol frame.
 boolean isTransactionOpen()
          Whether there is an open transaction in this frame, ie, whether beginTransaction has been called on this frame which has not been committed or rolled back.
 DCBindingContainer putBindingContainer(java.lang.Object key, DCBindingContainer bc)
           
 void release()
          Release the datacontrol frame.
 void releaseSavepoint(SavepointHandle handle)
          Release a save point when it is no longer needed.
 DCBindingContainer removeBindingContainer(java.lang.Object key)
           
 void removeDataControl(java.lang.Object key)
           
 void removeSnapshot(java.io.Serializable handle)
          Removes the state snapshot associated with the snapshot handle.
 void restoreSavepoint(SavepointHandle handle)
          Restore the transaction back to a previously created checkpoint.
 void restoreSnapshot(java.io.Serializable handle)
          Restore the states of the DataControls in the frame with the snapshot states that are referenced by the handle.
 void resumeTransaction()
          Resume the transaction associated with with this context.
 void rollback()
          Rollback the underlying transaction.
 void setCurrent(boolean isCurrent)
          Notify the frame that it has been set current.
 void suspendTransaction()
          Called to suspend the transaction associated with this datacontrol frame.
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataControlFrameImpl

public DataControlFrameImpl(java.lang.String name,
                            DataControlFrameImpl parentFrame,
                            java.util.List<DataControlPolicy> policies,
                            DataControlPolicy defaultPolicy,
                            BindingContext bindingContext)
Constructor

Parameters:
name - Name of this frame.
policies - An optional list of DataControlPolicy objects for datacontrols that have different policies than the default policy.
defaultPolicy - The default DataControlPolicy for all datacontrols in this datacontrol frame.
bindingContext - the BindingContext that creates this frame.
Method Detail

release

public void release()
Release the datacontrol frame. It is an error to call any other methods on the datacontrol frame after it has been released.

Specified by:
release in interface DataControlFrame

getSyncLock

public java.util.concurrent.locks.ReentrantLock getSyncLock()

unlock

public void unlock()

setCurrent

public void setCurrent(boolean isCurrent)
Notify the frame that it has been set current. Note that a frame that is setCurrent is not guaranteed to be unset.

For internal use only. Application developers should not use this

beginRequest

public void beginRequest(BindingContext bindingCtx,
                         java.util.HashMap requestCtx)

endRequest

public void endRequest(BindingContext bindingCtx,
                       java.util.HashMap requestCtx)

datacontrols

public final java.util.Collection<DCDataControl> datacontrols()
Description copied from interface: DataControlFrame
Returns the set of data controls in the frame

Specified by:
datacontrols in interface DataControlFrame
Returns:

createSavepoint

public SavepointHandle createSavepoint()
Create a savepoint marking the current state of the task flow context.

Specified by:
createSavepoint in interface DataControlFrame
Returns:
a checkpoint.

restoreSavepoint

public void restoreSavepoint(SavepointHandle handle)
Restore the transaction back to a previously created checkpoint.

Specified by:
restoreSavepoint in interface DataControlFrame
Parameters:
cp - the checkpoint to return to. Must have been created by a call to createSavepoint() on the same transaction.

releaseSavepoint

public void releaseSavepoint(SavepointHandle handle)
Release a save point when it is no longer needed. It is an error to attempt to restore a save point after it has been released.

Specified by:
releaseSavepoint in interface DataControlFrame
Parameters:
cp - the savepoint to release. Must have been created by a call to createSavepoint() on the same transaction.

createSnapshot

public java.io.Serializable createSnapshot()
Description copied from interface: DataControlFrame
Creates a snapshot of the states of the DataControls in the frame. A snapshot may be used to save the DataControlFrame state so that it may be restored some time later. Returns a serializable handle to the snapshot.

Specified by:
createSnapshot in interface DataControlFrame
Returns:
a snapshot handle

restoreSnapshot

public void restoreSnapshot(java.io.Serializable handle)
Description copied from interface: DataControlFrame
Restore the states of the DataControls in the frame with the snapshot states that are referenced by the handle.

Specified by:
restoreSnapshot in interface DataControlFrame
Parameters:
handle - Serializable a snaphsot handle that was created with DataControlFrame.createSnapshot().

removeSnapshot

public void removeSnapshot(java.io.Serializable handle)
Description copied from interface: DataControlFrame
Removes the state snapshot associated with the snapshot handle.

Specified by:
removeSnapshot in interface DataControlFrame
Parameters:
handle - Serializable a snapshot handle that was created with DataControlFrame.createSnapshot().

beginTransaction

public void beginTransaction(TransactionProperties properties)
Begin a new transaction.

Specified by:
beginTransaction in interface DataControlFrame
Parameters:
properties - the transaction properties. Used by beginTransaction in BindingContext

suspendTransaction

public void suspendTransaction()
Called to suspend the transaction associated with this datacontrol frame. Typically used when it's know that on activity will be performed on the transaction for an extended period of time, such as when a second, independent transaction is being used for some other unit of work.

Specified by:
suspendTransaction in interface DataControlFrame

resumeTransaction

public void resumeTransaction()
Resume the transaction associated with with this context. Used by resumeTransaction in BindingContext.

Specified by:
resumeTransaction in interface DataControlFrame

getOpenTransactionName

public java.lang.String getOpenTransactionName()
Returns the name of the transaction if a transaction is open in this datacontrol frame.

If the transaction policy of this frame is "existing", it returns the name of the transaction of the other frame specified in the datacontrol policy if that transaction is open.

A transaction is open and active if beginTransaction has been called but it has not been committed or rolled back.

Specified by:
getOpenTransactionName in interface DataControlFrame
Returns:
Name of the open transaction in this datacontrol frame, or null if there is no transaction in this frame, or the transaction is not open.

isTransactionOpen

public boolean isTransactionOpen()
Whether there is an open transaction in this frame, ie, whether beginTransaction has been called on this frame which has not been committed or rolled back.

Specified by:
isTransactionOpen in interface DataControlFrame
Returns:
True if there is an open transaction in this frame, false otherwise.

isTransactionDirty

public boolean isTransactionDirty()
Indicates if unsaved data modifications exists within the current datacontrol frame.

Specified by:
isTransactionDirty in interface DataControlFrame
Returns:
true indicates unsaved data exists,
false indicates there is no unsaved data.

getName

public java.lang.String getName()
Specified by:
getName in interface DataControlFrame
Returns:
the name for this datacontrol frame.

commit

public void commit()
Commit the current underlying transaction.

Specified by:
commit in interface DataControlFrame

rollback

public void rollback()
Rollback the underlying transaction.

Specified by:
rollback in interface DataControlFrame

findUniqueKey

public java.lang.String findUniqueKey(java.lang.String key,
                                      java.util.Map dcMap)
Description copied from interface: DataControlFrame
Return a key that is unique among the keys for datacontrols in the BindingContext. The unique key can be the same as the key passed into this method, or a different key if a unique key has been generated if it clashes with another datacontrol created by a different frame. This method is used by BindingContext only.

Specified by:
findUniqueKey in interface DataControlFrame
Parameters:
key - key for the datacontrol
dcMap - map of datacontrol from the BindingContext
Returns:
A unique name that can be used as key for storing the datacontrol into the data structures in the BindingContext. The name can be different from the key if more than one datacontrol frames reference different datacontrol instances using the same name.

removeDataControl

public void removeDataControl(java.lang.Object key)

addDataControl

public void addDataControl(java.lang.Object key,
                           DCDataControl dc)
Add an datacontrol to the list of datacontrols that this datacontrol frame should maintain. A datacontrol added using this method may not be maintained by this datacontrol frame depending on the DataControlPolicy. 9bginr-

Parameters:
key - key for the datacontrol
dc - A datacontrol to be added to the datacontrol frame.

findDataControl

public DCDataControl findDataControl(java.lang.String dcName)
Retrieve a datacontrol instance with the given name from this datacontrol frame.

Specified by:
findDataControl in interface DataControlFrame
Parameters:
dcName - Name of the datacontrol
Returns:
A datacontrol with the given name, or null if none can be found.
See Also:
DataControlPolicy.getDataControl()

findDataControl

public DCDataControl findDataControl(java.lang.String dcName,
                                     boolean create)

findDataControl

public DCDataControl findDataControl(java.lang.String dcUsageName,
                                     java.lang.String dcName,
                                     boolean create)

findPolicy

public DataControlPolicy findPolicy(java.lang.String name)
Retrieve a datacontrol policy with the given name from this datacontrol frame.

Specified by:
findPolicy in interface DataControlFrame
Parameters:
name - Name of the datacontrol
Returns:
A datacontrol policy with the given name, or null if none can be found.

getDefaultPolicy

public DataControlPolicy getDefaultPolicy()
Return the default datacontrol policy of this datacontrol frame.

Specified by:
getDefaultPolicy in interface DataControlFrame
Returns:
The default policy of this datacontrol frame.

addDataControlPolicy

public boolean addDataControlPolicy(DataControlPolicy policy)
Adds a datacontrol policy to this datacontrol frame. To be implemented.

Specified by:
addDataControlPolicy in interface DataControlFrame
Parameters:
policy - The datacontrol policy to be added.
Returns:
true if the policy has been added sucessfully, false if the policy cannot be added because a policy already exists for the given name.

containsDataControl

public boolean containsDataControl(java.lang.Object dc)

getBindingContainer

public DCBindingContainer getBindingContainer(java.lang.Object key)
Specified by:
getBindingContainer in interface DataControlFrame

putBindingContainer

public DCBindingContainer putBindingContainer(java.lang.Object key,
                                              DCBindingContainer bc)
Specified by:
putBindingContainer in interface DataControlFrame

removeBindingContainer

public DCBindingContainer removeBindingContainer(java.lang.Object key)
Specified by:
removeBindingContainer in interface DataControlFrame

getBindingContainers

public java.util.Collection<DCBindingContainer> getBindingContainers()
Specified by:
getBindingContainers in interface DataControlFrame

containsBindingContainer

public boolean containsBindingContainer(java.lang.Object bc)

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.6.0)

E10653-07

Copyright © 1997, 2011, Oracle. All rights reserved.