Oracle Application Development Framework Model and Business Components Java API Reference 10.1.3.1.0
B28969-01


oracle.adf.model.binding
Class DCDataControl

java.lang.Object
  extended byjava.util.AbstractMap
      extended byoracle.jbo.common.JboAbstractMap
          extended byoracle.adf.model.binding.DCDataControl

All Implemented Interfaces:
DataControl, oracle.adf.model.DataControl, DCDataControlManagement, java.util.Map
Direct Known Subclasses:
DCGenericDataControl, DCJboDataControl

public abstract class DCDataControl
extends oracle.jbo.common.JboAbstractMap
implements oracle.adf.model.DataControl, DCDataControlManagement

The application class that manages connection to a Data Provider object. The DCDataControl class provides:

10.1.3.1.0:
PUBLIC
See Also:
ApplicationModule, Transaction, DCTransactionStateListener, DCErrorHandler

Nested Class Summary

 

Nested classes inherited from class java.util.Map
java.util.Map.Entry

 

Field Summary
static byte ABSTRACT
           
static java.lang.String GET_ApplicationModule
           
static java.lang.String GET_dataProvider
           
static java.lang.String GET_DataProvider
           
static java.lang.String GET_MethodResults
           
static java.lang.String GET_Name
           
static byte JCLIENT
           
protected  java.util.ArrayList mBindingContainerList
           
protected  java.lang.Object mDataProvider
           
protected  DCErrorHandler mErrorHandler
           
protected  boolean mErrorHandlerActive
           
protected  DCErrorHandler mErrorHandlerThrow
           
protected  boolean mIsRoot
           
protected  LocaleContext mLocaleCtx
           
protected  java.lang.String mName
           
protected  DCDataControl mParent
           
protected  DCDataControl mRootApplication
           
protected  java.util.ArrayList mStatusBarList
          DCStatusBarInterface objects that are notified with status bar messages.
protected  java.util.ArrayList mTxnListeners
          DCTransactionStateListener objects that are notified of commit or rollback events when generated from the data-provider layer.
protected  java.lang.Object mUserData
           
static byte OPER_CTRL_BINDING_VALIDATION
           
static byte OPER_DATA_ROW_CREATE
           
static byte OPER_DATA_ROW_REMOVE
           
static byte OPER_DATA_ROW_UPDATE
           
static byte OPER_EXECUTE
           
static byte OPER_FIND_MODE
           
static byte OPER_SORT_COLLECTION
           
static java.lang.String PNAME_Type
           
static int REL_ALL_REFS
           
static int REL_DATA_REFS
           
static int REL_VIEW_REFS
           
static int REL_WEAK_DATA_REFS
           

 

Constructor Summary
protected DCDataControl()
           
protected DCDataControl(boolean root, java.lang.Object userData)
          Constructs a root DCDataControl object that connects to a Data Provider of the given name.

 

Method Summary
 void addBindingContainer(DCBindingContainer formBnd)
          Register the given form binding object with this application.
 void addBindingContainer(java.lang.String name, DCBindingContainer formBnd)
          Register the given form binding object with this application with the given name.
 void addBindingContainer(java.lang.String name, DCBindingContainer formBnd, DCBindingContainerDef formDef)
          Register the given form binding object with this application with the given name.
 void addBindingContainerRef(oracle.jbo.common.NamedObjectImpl formBnd)
          Register the given form binding object with this application.
 void addBindingWithExc(java.lang.String name)
           
protected  DCBindingContainer addOrCreateBindingContainer(java.lang.String name, DCBindingContainer formBnd, DCBindingContainerDef formDef, boolean initialize, boolean replace)
           
 void addStatusBarInterface(DCStatusBarInterface statusBar)
          Add the given status bar object to this application's list.
 void addTransactionStateListener(DCTransactionStateListener statusBar)
          Adds listeners like StatusBar and NavigationBars that have to listen and react to transaction's modified state.
protected abstract  void applySortCriteria(DCIteratorBinding iter, oracle.jbo.SortCriteria[] sortby)
           
abstract  void applyViewCriteria(ViewCriteria vc, DCIteratorBinding iter, RowSetIterator rsi)
          Internal: Applications should not use this method.
 void beginRequest(java.util.HashMap requestCtx)
          Invoked in some contexts to signal the beginning of a model request.
protected  void cacheMethodResult(DCInvokeMethod method, java.lang.Object result, java.lang.Object paramVals)
           
 void callCommitTransaction()
          Helper method that invokes beforeSaveTransaction event on all DCPanelBinding objects and then invokes the BC4J transaction's commit() method to save all changes to the database.
 void cleanup()
           
 void commitTransaction()
          Invokes the BC4J transaction's commit() method to save all changes to the database.
protected  void connect()
          If this DCDataControl is root, this method invokes the corresponding BC4J Transaction's connect() method to create a database connection.
 RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI, DCIteratorBinding iter, java.lang.String accName, java.lang.String beanClass)
          creates a accessor RSI using the current or the first row of the masterRSI and calling the get<accName> method on it to get the RSI dataprovider.
 RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI, Row row, DCIteratorBinding iter, java.lang.String accName, java.lang.String beanClass)
           
protected  RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI, Row row, DCIteratorBinding iter, java.lang.String accName, java.lang.String beanClass, boolean trackMaster)
           
 DCBindingContainer createBindingContainer(java.lang.String name, java.lang.String formDefName, boolean initialize)
          Create a DCBindingContainer instance using the given name and form definition.
 DCBindingContainer createBindingContainerInstance(java.lang.String mBindingContainerClassName)
           
 java.lang.Object createRowData(DCRowContext ctx)
          Create a new row for the iterator associated with the given iterator-binding at the given index and return the new row.
 RowSetIterator createRowSetIteratorImpl(DCIteratorBinding iter, java.lang.String defName, java.lang.Object sourceObj, RowSetIterator master)
          Creates an RSI for a given iterator and source collection/object.
protected abstract  RowSetIterator createRowSetIteratorImpl(java.lang.String defName, java.lang.Object sourceObj, RowSetIterator master)
          Create a DCRowSetIteratorImpl or a subclass thereof for the give defName element types, using the given source collection/object and optionally the master RSI if there is a dependency defined on the master.
 ViewCriteria createViewCriteria(DCIteratorBinding iter)
          Internal: Applications should not use this method. Create a new viewCriteria associated with the given iterator binding's collection.
 void displayStatus(DCIteratorBinding iterBinding, java.lang.String msgId, java.lang.Object[] params)
          Send the given message Id and parameter list along with the current iterator binding object to all status bar instances registered with this Application.
 void displayStatus(java.lang.String msg)
          Send the given message to all status bar interface objects registered with this application.
 void doneCommit(oracle.jbo.TransactionStateEvent event)
          Implementation of oracle.jbo.TransactionStateListener interface.
 void doneRollback(oracle.jbo.TransactionStateEvent event)
          Implementation of oracle.jbo.TransactionStateListener interface.
 void endRequest(java.util.HashMap requestCtx)
          Invoked in some contexts to signal the end of a model request.
protected abstract  void executeIteratorBinding(DCIteratorBinding iterBinding)
          Implies forced execute of the collection that this iterator binding is bound to.
protected abstract  void executeIteratorBindingIfNeeded(DCIteratorBinding iterBinding)
          This method is invoked when a bindingcontainer is 'refreshing' itself before it's data is displayed.
 void executeIteratorBindingWithParams(DCIteratorBinding iter, oracle.adf.model.OperationParameter[] params, java.lang.Object[] paramVals)
           
 DCBindingContainer findBindingContainer(java.lang.String name)
          Return the DCBindingContainer instance registered with this DCAppication with the given name.
 RowSetIterator findOrCreateAccessorRowSetIterator(DCIteratorBinding masterIter, DCIteratorBinding iter, java.lang.String accName, java.lang.String beanClass)
           
 RowSetIterator findOrCreateAccessorRowSetIterator(RowSetIterator masterRSI, DCIteratorBinding iter, java.lang.String accName, java.lang.String beanClass)
          Deprecated. since 10.1.2
 RowSetIterator findOrCreateMethodRowSetIterator(DCIteratorBinding iter, java.lang.String beanClass, java.lang.Object result)
           
protected  RowSetIterator findOrCreateRowSetIteratorImpl(DCIteratorBinding iter, java.lang.String defName, java.lang.Object sourceObj, RowSetIterator master)
           
protected  oracle.jbo.Variable findVariable(java.lang.String path)
           
 void focusGained(DCIteratorBinding iterBinding, DCControlBinding binding, int attrIndex)
          This method is used by the framework to display currency information in the status bars.
 java.lang.Object get(java.lang.Object keyObj)
          override hashmap.get()
protected abstract  java.lang.Object getAccessorValue(RowSetIterator masterRSI, Row row, DCIteratorBinding iter, java.lang.String accName)
           
 oracle.jbo.ApplicationModule getApplicationModule()
          For all nonbc4j Applications, this should return null.
 AttributeDef[] getAttributeDefs(DCIteratorBinding iterBinding, java.lang.String[] attrNames)
          Return attribute definition for the given iterator binding and for the given set of attributes from the elements-definition of the mapped collection.
 oracle.adf.model.BindingContext getBindingContext()
          Returns the binding context in which this datacontrol is registered
 DCErrorHandler getCurrentErrorHandler()
          Returns the DCErrorHandler registered with the root DCDataControl.
 java.lang.Object getDataProvider()
          Return the Business Service Object that this datacontrol is associated with.
 DCDataControlDef getDef()
          Returns the definition object for this DCDataControl
 Definition getDefinition(java.lang.String name, java.lang.Class type)
           
 boolean getErrorHandlerActive()
          Returns the error-handler active state of the root DCDataControl object.
protected abstract  long getEstimatedRowCount(DCIteratorBinding iter)
          Implement estimated row count logic in this method and return the row count for a collection bound to this iterator.
 LocaleContext getLocaleContext()
          Returns the locale for this Application
 java.util.Map getMethodResults()
          For looking up method results stored in this DataControl.
 int getMethodResultUseCount(java.lang.Object key)
           
 java.lang.String getName()
          Returns the instance name of this DCDataControl object.
 DCDataControl getParent()
          Returns the container DCDataControl object if any.
 DCDataControl getRootDataControl()
          Returns the root DCDataControl object.
protected abstract  RowSetIterator getRowSetIterator(java.lang.String masterName)
          Given the name of an RSI, find if it's already created and cached on the datacontrol
 oracle.adf.share.security.SecurityContext getSecurityContext()
           
 oracle.jbo.SessionContext getSessionContext()
           
protected  oracle.jbo.SessionContextManager getSessionContextManager()
           
protected abstract  oracle.jbo.SortCriteria[] getSortCriteria(DCIteratorBinding iter)
           
 java.lang.Object getUserData()
           
 ViewCriteria getViewCriteria(DCIteratorBinding iter)
          Internal: Applications should not use this method. Return viewCriteria associated with the given iterator binding's collection.
 boolean hasBindingsWithExc()
           
 int hashCode()
           
 boolean hasOperationParamsChanged(OperationInfo info)
           
 boolean hasPermission(DCControlBinding binding, java.lang.String actions)
           
 boolean hasPermission(DCControlBinding binding, java.lang.String target, java.lang.String actions)
           
 boolean hasPermission(java.security.Permission permission)
           
 void initialize()
          *** Advanced method ***
protected  void initializeBindingContainer(DCBindingContainerDef formDef, DCBindingContainer formBnd, boolean initialize)
           
 void initializeContainerFromDef(java.lang.String name)
           
 void initializeFromMetadata(java.util.Map map)
           
protected  java.lang.Object internalGet(java.lang.String key)
          For EL evaluation.
protected  Row internalGetCurrentRow(DCIteratorBinding iter)
           
protected  void internalPut(java.lang.String key, java.lang.Object value)
           
protected  void internalSetTransactionStateChanged(boolean state)
           
 java.lang.Object invokeMethod(DCInvokeMethodDef methodInfo, java.util.ArrayList params)
          Deprecated. since 10.1.3. not called anymore. Use invokeOperation() instead.
protected  java.lang.Object invokeMethod(DCInvokeMethod method, oracle.adf.model.OperationBinding action, java.util.Map params)
          Override this method if a datacontrol wants to implement custom invocation of a method and avoid introspection and invoke method call using reflection.
 boolean invokeOperation(java.util.Map ctx, OperationBinding action)
          All OperationBindings should first delegate to the DataControl associated with the binding to perform the action.
 boolean isAttributeSortable(DCIteratorBinding iter, AttributeDef ad)
           
protected  boolean isBoundRowIteratorEvent(DCIteratorBinding iter, oracle.jbo.JboEvent ev)
           
 boolean isClientTier()
          Returns true in case of BC4J client-tier app.
 boolean isJClientApp()
           
 boolean isOperationSupported(DCIteratorBinding iterBinding, byte operation)
          Returns true for operation = OPER_CTRL_BINDING_VALIDATION Returns false for all other cases.
 boolean isRoot()
          Returns true if this DCDataControl is the root DCDataControl.
abstract  boolean isTransactionDirty()
          Returns true if this transaction has been dirtied by this application.
 boolean isTransactionModified()
          Returns true if this DCDataControl has modified attribute values.
protected  void rebuildIteratorIfNeeded(DCIteratorBinding iterBinding)
           
 java.lang.Object registerDataProvider(DCRowContext ctx)
          Called before the row in the RowContext object is modified/marked as removed.
 void release()
          Calls release(REL_ALL_REFS);
 void release(int flags)
          Based on the value of the flags parameter, releases all references to the objects in the data provider layer (BC4J or other data-provider objects).
protected  void removeBindingContainer(DCBindingContainer formBnd)
          Remove the DCBindingContainer object of the given name (if any).
 void removeBindingWithExc(java.lang.String name)
           
 boolean removeRowData(DCRowContext ctx)
          This method is to remove the row object (the obj parameter) from the underlying data source.
 boolean removeRowDataFromCollection(DCRowContext ctx)
          This method is to remove the row object (the obj parameter) from the collection.
 void removeStatusBarInterface(DCStatusBarInterface statusBar)
          Remove the given instance of status bar interface if found.
 void removeTransactionStateListener(DCTransactionStateListener statusBar)
          Remove the given object from JUTransactionStateListener list.
 void reportException(DCBindingContainer formBnd, java.lang.Exception ex)
          This method is used by all framework binding objects to report exceptions.
protected  void resetAttributeExceptionInRow(DCIteratorBinding iter, Row row, AttributeDef def, oracle.jbo.AttrValException ave)
           
 boolean resetState()
          Resets the DataControl.
protected  AttributeDef[] resolveAttributeDefs(StructureDef def, java.lang.String[] attrNames)
           
 void rollbackTransaction()
          Helper method that invokes rollback on the current Transaction.
 void setAttributeInRow(DCIteratorBinding iterBind, Row row, AttributeDef ad, java.lang.Object value)
           
 void setBindingContext(oracle.adf.model.BindingContext ctx)
           
 void setClientApp(byte clientType)
           
abstract  void setCurrentRowWithKey(DCIteratorBinding iter, Key keyObj)
          Use the given key to set the current row in the RowSetIterator for the given iteratorbinding.
abstract  void setCurrentRowWithKey(DCIteratorBinding iter, java.lang.String stringKey)
          Converts the serialized stringKey into a Row key object (using collection's key metadata) and then calls findByKey on the RowSetIterator to find the row matching this key.
abstract  void setCurrentRowWithKeyValue(DCIteratorBinding iter, java.lang.String stringValue)
          This method works for Collections with only one Key attribute and not for multi-part attribute keys.
protected  void setDataProvider(java.lang.Object obj)
           
 void setDef(DCDataControlDef appDef)
          Sets the definition object of this DCDataControl Object
 void setErrorHandler(java.lang.Object errHandlerObj)
          Registers a DCErrorHandler with the root DCDataControl.
 void setErrorHandlerActive(boolean b)
          *** Advanced method ***
 void setLocaleContext(LocaleContext locale)
          Helper method that sets the locale in the current Application.
 void setName(java.lang.String name)
          Sets the instance name of this DCDataControl Object
 void setSessionContext(oracle.jbo.SessionContext sessionContext)
           
 void setTransactionModified()
          If this transaction is not in modified state, this method sets it to a modified state.
 void sync(java.lang.String syncFromDiagnostic)
          Incase syncNeeded, then use this event to synchronize data from remote tier in batch.
 void syncIfNeeded(java.lang.String syncFromDiagnostic)
          Incase syncNeeded, then use this event to synchronize data from remote tier in batch.
 boolean syncNeeded()
          Primarily used in ADFBC which returns true, if it is deployed in batchmode.
 java.lang.String toString()
           
 void transactionStateChanged(boolean state)
          Use this method to notify all transaction state change listeners of the change
 void validate()
          Called when datacontrol changes needs to be validated after updates have been processed for a page.

 

Methods inherited from class oracle.jbo.common.JboAbstractMap
entrySet, equals, put

 

Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, isEmpty, keySet, putAll, remove, size, values

 

Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, isEmpty, keySet, put, putAll, remove, size, values

 

Field Detail

mIsRoot

protected boolean mIsRoot

mParent

protected DCDataControl mParent

mRootApplication

protected DCDataControl mRootApplication

mUserData

protected java.lang.Object mUserData

mName

protected java.lang.String mName

mBindingContainerList

protected java.util.ArrayList mBindingContainerList

mErrorHandler

protected DCErrorHandler mErrorHandler

mErrorHandlerThrow

protected DCErrorHandler mErrorHandlerThrow

mErrorHandlerActive

protected boolean mErrorHandlerActive

mLocaleCtx

protected LocaleContext mLocaleCtx

ABSTRACT

public static byte ABSTRACT

JCLIENT

public static byte JCLIENT

OPER_DATA_ROW_UPDATE

public static final byte OPER_DATA_ROW_UPDATE
See Also:
Constant Field Values

OPER_DATA_ROW_CREATE

public static final byte OPER_DATA_ROW_CREATE
See Also:
Constant Field Values

OPER_DATA_ROW_REMOVE

public static final byte OPER_DATA_ROW_REMOVE
See Also:
Constant Field Values

OPER_FIND_MODE

public static final byte OPER_FIND_MODE
See Also:
Constant Field Values

OPER_CTRL_BINDING_VALIDATION

public static final byte OPER_CTRL_BINDING_VALIDATION
See Also:
Constant Field Values

OPER_EXECUTE

public static final byte OPER_EXECUTE
See Also:
Constant Field Values

OPER_SORT_COLLECTION

public static final byte OPER_SORT_COLLECTION
See Also:
Constant Field Values

mDataProvider

protected java.lang.Object mDataProvider

GET_MethodResults

public static final java.lang.String GET_MethodResults
See Also:
Constant Field Values

GET_ApplicationModule

public static final java.lang.String GET_ApplicationModule
See Also:
Constant Field Values

GET_DataProvider

public static final java.lang.String GET_DataProvider
See Also:
Constant Field Values

GET_dataProvider

public static final java.lang.String GET_dataProvider
See Also:
Constant Field Values

GET_Name

public static final java.lang.String GET_Name
See Also:
Constant Field Values

REL_ALL_REFS

public static int REL_ALL_REFS

REL_DATA_REFS

public static int REL_DATA_REFS

REL_VIEW_REFS

public static int REL_VIEW_REFS

REL_WEAK_DATA_REFS

public static int REL_WEAK_DATA_REFS

PNAME_Type

public static final java.lang.String PNAME_Type
See Also:
Constant Field Values

mStatusBarList

protected java.util.ArrayList mStatusBarList
DCStatusBarInterface objects that are notified with status bar messages.

mTxnListeners

protected java.util.ArrayList mTxnListeners
DCTransactionStateListener objects that are notified of commit or rollback events when generated from the data-provider layer.

Constructor Detail

DCDataControl

protected DCDataControl()

DCDataControl

protected DCDataControl(boolean root,
                        java.lang.Object userData)
Constructs a root DCDataControl object that connects to a Data Provider of the given name.
Parameters:
root - If this DCDataControl is a root DCDataControl managing the transaction.
userData - Data to store with the DCDataControl object.

Method Detail

getName

public final java.lang.String getName()
Returns the instance name of this DCDataControl object.
Specified by:
getName in interface oracle.adf.model.DataControl

setName

public final void setName(java.lang.String name)
Sets the instance name of this DCDataControl Object

getDef

public final DCDataControlDef getDef()
Returns the definition object for this DCDataControl

setDef

public final void setDef(DCDataControlDef appDef)
Sets the definition object of this DCDataControl Object

initializeFromMetadata

public void initializeFromMetadata(java.util.Map map)

initialize

public void initialize()
*** Advanced method ***

Creates a connection to the data-provider layer.


getDataProvider

public java.lang.Object getDataProvider()
Description copied from interface: oracle.adf.model.DataControl
Return the Business Service Object that this datacontrol is associated with.
Specified by:
getDataProvider in interface oracle.adf.model.DataControl

setDataProvider

protected void setDataProvider(java.lang.Object obj)

reportException

public final void reportException(DCBindingContainer formBnd,
                                  java.lang.Exception ex)
This method is used by all framework binding objects to report exceptions. If this DCDataControl is not the root, it calls the equivalent method on the root.

If the error handler is set to active state, then this method calls the registered error handler's reportException method. Othewise, it simply throws the given exception as a JboException.

See Also:
DCErrorHandler, JboException

getCurrentErrorHandler

public final DCErrorHandler getCurrentErrorHandler()
Returns the DCErrorHandler registered with the root DCDataControl. By default an ADF Application has an instance of DCErrorHandlerDialog registered as the default DCErrorHandler.
See Also:
JUErrorHandlerDialog

setErrorHandler

public void setErrorHandler(java.lang.Object errHandlerObj)
Registers a DCErrorHandler with the root DCDataControl. By default an ADF application has an instance of DCErrorHandlerDialog registered as the default DCErrorHandler. Applications should use this method to register custom error handling object so that all errors raised in the framework goes through the Application's error handling object. Custom error handlers need to implement the DCErrorHandler interface.

Custom error handlers may also implement oracle.jbo.JboExceptionHandler to handle batched Exceptions raised during client-side processing of Exceptions thrown in the Business Components tier. after the DCErrorHandler is set with DCDataControl in this method.

Note that errors are sent to the registered error handler only when the error handler state is marked active (which is true by default) using the setErrorHandlerActive method.

Parameters:
errHandlerObj - An implementation of DCErrorHandler interface that may optionally implement JboExceptionHandler interface too. If errHandler implements the JboExceptionHandler, this method sets it as the ExceptionHandler on the root ApplicationModule that this client Application is connected with. Else, method sets a default ExceptionHandler which will collect all Exceptions and throw a new JboException with these Exceptions set as in the new JboException's details list, for the errHandler to display as one JboException with a bag of Exceptions.
See Also:
JUErrorHandler, JUErrorHandlerDialog, JboExceptionHandler, ApplicationModule

getErrorHandlerActive

public final boolean getErrorHandlerActive()
Returns the error-handler active state of the root DCDataControl object. This is used to control whether to throw an exception raised by the framework (which is used by automated regression tests to trap exceptions and log them). By default the state is set to true - meaning raise all exceptions via the registered error handler.

setErrorHandlerActive

public final void setErrorHandlerActive(boolean b)
*** Advanced method ***

Sets the error-handler active state of the root DCDataControl object. This is used to control whether to throw an exception raised by the framework (which is used by automated regression tests to trap exceptions and log them). By default the state is set to true - meaning raise all exceptions via the registered error handler.


connect

protected void connect()
If this DCDataControl is root, this method invokes the corresponding BC4J Transaction's connect() method to create a database connection. Also this method is used to register the application as a TransactionStateListener on the BC4J Transaction object.

getLocaleContext

public LocaleContext getLocaleContext()
Returns the locale for this Application

setLocaleContext

public void setLocaleContext(LocaleContext locale)
Helper method that sets the locale in the current Application.

getApplicationModule

public oracle.jbo.ApplicationModule getApplicationModule()
For all nonbc4j Applications, this should return null. Returns the associated oracle.jbo.ApplicationModule object

getRowSetIterator

protected abstract RowSetIterator getRowSetIterator(java.lang.String masterName)
Given the name of an RSI, find if it's already created and cached on the datacontrol

getAccessorValue

protected abstract java.lang.Object getAccessorValue(RowSetIterator masterRSI,
                                                     Row row,
                                                     DCIteratorBinding iter,
                                                     java.lang.String accName)

createAccessorRowSetIterator

public RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI,
                                                   DCIteratorBinding iter,
                                                   java.lang.String accName,
                                                   java.lang.String beanClass)
creates a accessor RSI using the current or the first row of the masterRSI and calling the get<accName> method on it to get the RSI dataprovider.

createAccessorRowSetIterator

public RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI,
                                                   Row row,
                                                   DCIteratorBinding iter,
                                                   java.lang.String accName,
                                                   java.lang.String beanClass)

createAccessorRowSetIterator

protected RowSetIterator createAccessorRowSetIterator(RowSetIterator masterRSI,
                                                      Row row,
                                                      DCIteratorBinding iter,
                                                      java.lang.String accName,
                                                      java.lang.String beanClass,
                                                      boolean trackMaster)

findOrCreateMethodRowSetIterator

public RowSetIterator findOrCreateMethodRowSetIterator(DCIteratorBinding iter,
                                                       java.lang.String beanClass,
                                                       java.lang.Object result)

findOrCreateAccessorRowSetIterator

public RowSetIterator findOrCreateAccessorRowSetIterator(RowSetIterator masterRSI,
                                                         DCIteratorBinding iter,
                                                         java.lang.String accName,
                                                         java.lang.String beanClass)
Deprecated. since 10.1.2
Use findOrCreateAccessorRowSetIterator(DCIteratorBinding masterIter....) instead.

internalGetCurrentRow

protected Row internalGetCurrentRow(DCIteratorBinding iter)

findOrCreateAccessorRowSetIterator

public RowSetIterator findOrCreateAccessorRowSetIterator(DCIteratorBinding masterIter,
                                                         DCIteratorBinding iter,
                                                         java.lang.String accName,
                                                         java.lang.String beanClass)

createRowSetIteratorImpl

protected abstract RowSetIterator createRowSetIteratorImpl(java.lang.String defName,
                                                           java.lang.Object sourceObj,
                                                           RowSetIterator master)
Create a DCRowSetIteratorImpl or a subclass thereof for the give defName element types, using the given source collection/object and optionally the master RSI if there is a dependency defined on the master.

findOrCreateRowSetIteratorImpl

protected RowSetIterator findOrCreateRowSetIteratorImpl(DCIteratorBinding iter,
                                                        java.lang.String defName,
                                                        java.lang.Object sourceObj,
                                                        RowSetIterator master)

createRowSetIteratorImpl

public final RowSetIterator createRowSetIteratorImpl(DCIteratorBinding iter,
                                                     java.lang.String defName,
                                                     java.lang.Object sourceObj,
                                                     RowSetIterator master)
Creates an RSI for a given iterator and source collection/object.

isRoot

public final boolean isRoot()
Returns true if this DCDataControl is the root DCDataControl. Root DCDataControl is responsible for establishing connection to a DataProvider and setting up Transaction objects.

getParent

public final DCDataControl getParent()
Returns the container DCDataControl object if any. This should be null in case this application object is the root.

getRootDataControl

public final DCDataControl getRootDataControl()
Returns the root DCDataControl object.

getUserData

public final java.lang.Object getUserData()

removeBindingContainer

protected final void removeBindingContainer(DCBindingContainer formBnd)
Remove the DCBindingContainer object of the given name (if any).

addBindingContainer

public final void addBindingContainer(DCBindingContainer formBnd)
Register the given form binding object with this application. If this form binding object has no name or null name, framework generates a unique name for the object (in the context of this application module).
Throws:
NameClashException - If there is another object of the same name already registered, this method will throw this exception.

addBindingContainerRef

public final void addBindingContainerRef(oracle.jbo.common.NamedObjectImpl formBnd)
Register the given form binding object with this application. If this form binding object has no name or null name, framework generates a unique name for the object (in the context of this application module).
Throws:
NameClashException - If there is another object of the same name already registered, this method will throw this exception.

addBindingContainer

public final void addBindingContainer(java.lang.String name,
                                      DCBindingContainer formBnd,
                                      DCBindingContainerDef formDef)
Register the given form binding object with this application with the given name.
Throws:
InvalidObjNameException - If the given name does not follow the BC4J component or Java Identifier naming rules.
NameClashException - If there is another object of the same name already registered, this method will throw this exception.
See Also:
JboNameUtil.isNameValid(String)

addBindingContainer

public final void addBindingContainer(java.lang.String name,
                                      DCBindingContainer formBnd)
Register the given form binding object with this application with the given name.
Throws:
InvalidObjNameException - If the given name does not follow the BC4J component or Java Identifier naming rules.
NameClashException - If there is another object of the same name already registered, this method will throw this exception.
See Also:
JboNameUtil.isNameValid(String)

initializeBindingContainer

protected void initializeBindingContainer(DCBindingContainerDef formDef,
                                          DCBindingContainer formBnd,
                                          boolean initialize)

addOrCreateBindingContainer

protected DCBindingContainer addOrCreateBindingContainer(java.lang.String name,
                                                         DCBindingContainer formBnd,
                                                         DCBindingContainerDef formDef,
                                                         boolean initialize,
                                                         boolean replace)

findBindingContainer

public final DCBindingContainer findBindingContainer(java.lang.String name)
Return the DCBindingContainer instance registered with this DCAppication with the given name. If the name does not match, return null.

createBindingContainer

public final DCBindingContainer createBindingContainer(java.lang.String name,
                                                       java.lang.String formDefName,
                                                       boolean initialize)
Create a DCBindingContainer instance using the given name and form definition.

isJClientApp

public boolean isJClientApp()

setClientApp

public void setClientApp(byte clientType)

createBindingContainerInstance

public DCBindingContainer createBindingContainerInstance(java.lang.String mBindingContainerClassName)

initializeContainerFromDef

public void initializeContainerFromDef(java.lang.String name)

addStatusBarInterface

public final void addStatusBarInterface(DCStatusBarInterface statusBar)
Add the given status bar object to this application's list. Messages sent via displayMessage method will be given out to all registered status bar instances.

removeStatusBarInterface

public final void removeStatusBarInterface(DCStatusBarInterface statusBar)
Remove the given instance of status bar interface if found.

displayStatus

public final void displayStatus(DCIteratorBinding iterBinding,
                                java.lang.String msgId,
                                java.lang.Object[] params)
Send the given message Id and parameter list along with the current iterator binding object to all status bar instances registered with this Application. This method is used by the framework to display status bar messages from the oracle.jbo.uicli.UIMessageBundle

displayStatus

public final void displayStatus(java.lang.String msg)
Send the given message to all status bar interface objects registered with this application.

focusGained

public final void focusGained(DCIteratorBinding iterBinding,
                              DCControlBinding binding,
                              int attrIndex)
This method is used by the framework to display currency information in the status bars. When a control bound to a given attribute for a given iterator binding gets focus, this method is invoked to update all status bars.

hasBindingsWithExc

public final boolean hasBindingsWithExc()

validate

public void validate()
Called when datacontrol changes needs to be validated after updates have been processed for a page.

commitTransaction

public void commitTransaction()
Invokes the BC4J transaction's commit() method to save all changes to the database.

callCommitTransaction

public final void callCommitTransaction()
Helper method that invokes beforeSaveTransaction event on all DCPanelBinding objects and then invokes the BC4J transaction's commit() method to save all changes to the database.

rollbackTransaction

public void rollbackTransaction()
Helper method that invokes rollback on the current Transaction.

isTransactionModified

public final boolean isTransactionModified()
Returns true if this DCDataControl has modified attribute values.

setTransactionModified

public void setTransactionModified()
If this transaction is not in modified state, this method sets it to a modified state. This method is invoked in the framework to set the transaction state to modified status. Also all DCTransactionStateListeners are notified of this state-change so that status bars and navigation bars could update their display.

internalSetTransactionStateChanged

protected void internalSetTransactionStateChanged(boolean state)

transactionStateChanged

public final void transactionStateChanged(boolean state)
Use this method to notify all transaction state change listeners of the change

addTransactionStateListener

public final void addTransactionStateListener(DCTransactionStateListener statusBar)
Adds listeners like StatusBar and NavigationBars that have to listen and react to transaction's modified state.

removeTransactionStateListener

public final void removeTransactionStateListener(DCTransactionStateListener statusBar)
Remove the given object from JUTransactionStateListener list.

doneCommit

public final void doneCommit(oracle.jbo.TransactionStateEvent event)
Implementation of oracle.jbo.TransactionStateListener interface. Sends the transactionStateChanged event to all DCTransactionStateListeners registered with this application.
Parameters:
event - A description of the event.

doneRollback

public final void doneRollback(oracle.jbo.TransactionStateEvent event)
Implementation of oracle.jbo.TransactionStateListener interface. Sends the transactionStateChanged event to all DCTransactionStateListeners registered with this application.
Parameters:
event - A description of the event.

beginRequest

public void beginRequest(java.util.HashMap requestCtx)
Invoked in some contexts to signal the beginning of a model request. For example, if the DataControl is referenced in a web application then this method will be invoked by the ADF framework before control is forwarded to the first Servlet defined by the request.

Subclassing datacontrols may extend this method to perform request level initialization of the DataControl.

This method is guaranteed to be called only once per browser request. Page forwards should not result in multiple invocations.

Specified by:
beginRequest in interface DCDataControlManagement
Parameters:
requestCtx - a HashMap representing request context. Web applications which require request context may use the BindingContext.HTTP_REQUEST and BindingContext.HTTP_RESPONSE keys to acquire a reference from from the BindingContext.

endRequest

public void endRequest(java.util.HashMap requestCtx)
Invoked in some contexts to signal the end of a model request. For example, if the DataControl is referenced in a web application then this method will be invoked by the ADF framework after control is returned from the last Servlet defined by the request page flow.

Subclassing datacontrols may extend this method to perform request level cleanup of the DataControl.

This method is guaranteed to be called only once per browser request. Page forwards should not result in multiple invocations.

Specified by:
endRequest in interface DCDataControlManagement
Parameters:
requestCtx - a HashMap representing request context. Web applications which require request context may use the BindingContext.HTTP_REQUEST and BindingContext.HTTP_RESPONSE keys to acquire a reference from from the BindingContext.

release

public void release()
Calls release(REL_ALL_REFS);
Specified by:
release in interface DCDataControlManagement

getDefinition

public Definition getDefinition(java.lang.String name,
                                java.lang.Class type)

release

public void release(int flags)
Based on the value of the flags parameter, releases all references to the objects in the data provider layer (BC4J or other data-provider objects). Valid values for flags are:
Specified by:
release in interface oracle.adf.model.DataControl

get

public java.lang.Object get(java.lang.Object keyObj)
override hashmap.get()
Specified by:
get in interface java.util.Map

internalGet

protected java.lang.Object internalGet(java.lang.String key)
For EL evaluation. Properties returned vis getter on this control bindings are:

internalPut

protected void internalPut(java.lang.String key,
                           java.lang.Object value)

cleanup

public void cleanup()

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map

rebuildIteratorIfNeeded

protected void rebuildIteratorIfNeeded(DCIteratorBinding iterBinding)

executeIteratorBinding

protected abstract void executeIteratorBinding(DCIteratorBinding iterBinding)
Implies forced execute of the collection that this iterator binding is bound to. Incase of database based collections, ideally, this should 're-execute' the database query. This method is invoked via the Execute control binding action.

executeIteratorBindingIfNeeded

protected abstract void executeIteratorBindingIfNeeded(DCIteratorBinding iterBinding)
This method is invoked when a bindingcontainer is 'refreshing' itself before it's data is displayed. Only execute the collections bound to this iterator if they're not executed yet. Incase of method-result bound collections, this method may refresh the collection references in the associated RSIs.

getAttributeDefs

public AttributeDef[] getAttributeDefs(DCIteratorBinding iterBinding,
                                       java.lang.String[] attrNames)
Return attribute definition for the given iterator binding and for the given set of attributes from the elements-definition of the mapped collection.

isAttributeSortable

public boolean isAttributeSortable(DCIteratorBinding iter,
                                   AttributeDef ad)

isOperationSupported

public boolean isOperationSupported(DCIteratorBinding iterBinding,
                                    byte operation)
Returns true for operation = OPER_CTRL_BINDING_VALIDATION Returns false for all other cases.

setBindingContext

public final void setBindingContext(oracle.adf.model.BindingContext ctx)

getBindingContext

public final oracle.adf.model.BindingContext getBindingContext()
Returns the binding context in which this datacontrol is registered

invokeMethod

public java.lang.Object invokeMethod(DCInvokeMethodDef methodInfo,
                                     java.util.ArrayList params)
Deprecated. since 10.1.3. not called anymore. Use invokeOperation() instead.

invokeMethod

protected java.lang.Object invokeMethod(DCInvokeMethod method,
                                        oracle.adf.model.OperationBinding action,
                                        java.util.Map params)
Override this method if a datacontrol wants to implement custom invocation of a method and avoid introspection and invoke method call using reflection. ADF calls this method to invoke a methods bound via custom method-action binding.

invokeOperation

public boolean invokeOperation(java.util.Map ctx,
                               OperationBinding action)
Description copied from interface: DataControl
All OperationBindings should first delegate to the DataControl associated with the binding to perform the action. DataControls may choose to interpret a given action differently based on the data/collection that action is bound to.
Specified by:
invokeOperation in interface DataControl
Returns:
true if this datacontrol has handled this action, false if the action should be interpreted in the bindings framework or in the caller.

addBindingWithExc

public void addBindingWithExc(java.lang.String name)

removeBindingWithExc

public void removeBindingWithExc(java.lang.String name)

isTransactionDirty

public abstract boolean isTransactionDirty()
Returns true if this transaction has been dirtied by this application.

isClientTier

public boolean isClientTier()
Returns true in case of BC4J client-tier app.

toString

public java.lang.String toString()

syncNeeded

public boolean syncNeeded()
Primarily used in ADFBC which returns true, if it is deployed in batchmode.

syncIfNeeded

public void syncIfNeeded(java.lang.String syncFromDiagnostic)
Incase syncNeeded, then use this event to synchronize data from remote tier in batch. This event differs from sync() in that this event synchronizes only if some client operation has marked that a visit to middle tier is necessary. sync() will visit middle tier regardless.

sync

public void sync(java.lang.String syncFromDiagnostic)
Incase syncNeeded, then use this event to synchronize data from remote tier in batch.

getEstimatedRowCount

protected abstract long getEstimatedRowCount(DCIteratorBinding iter)
Implement estimated row count logic in this method and return the row count for a collection bound to this iterator.

setSessionContext

public void setSessionContext(oracle.jbo.SessionContext sessionContext)

getSessionContext

public oracle.jbo.SessionContext getSessionContext()

getSessionContextManager

protected oracle.jbo.SessionContextManager getSessionContextManager()

setCurrentRowWithKeyValue

public abstract void setCurrentRowWithKeyValue(DCIteratorBinding iter,
                                               java.lang.String stringValue)
This method works for Collections with only one Key attribute and not for multi-part attribute keys.

Converts the stringValue into a Row key (using collection's key metadata) and then calls findByKey on the RowSetIterator to find the row matching this key. If a row is found, that row is set as current.


setCurrentRowWithKey

public abstract void setCurrentRowWithKey(DCIteratorBinding iter,
                                          java.lang.String stringKey)
Converts the serialized stringKey into a Row key object (using collection's key metadata) and then calls findByKey on the RowSetIterator to find the row matching this key. If a row is found, that row is set as current.

setCurrentRowWithKey

public abstract void setCurrentRowWithKey(DCIteratorBinding iter,
                                          Key keyObj)
Use the given key to set the current row in the RowSetIterator for the given iteratorbinding.

registerDataProvider

public java.lang.Object registerDataProvider(DCRowContext ctx)
Called before the row in the RowContext object is modified/marked as removed. This gives datacontrol implementations a chance to register the row's data-provider as a modified object in the associated model.

setAttributeInRow

public void setAttributeInRow(DCIteratorBinding iterBind,
                              Row row,
                              AttributeDef ad,
                              java.lang.Object value)

createRowData

public java.lang.Object createRowData(DCRowContext ctx)
Create a new row for the iterator associated with the given iterator-binding at the given index and return the new row.

removeRowData

public boolean removeRowData(DCRowContext ctx)
This method is to remove the row object (the obj parameter) from the underlying data source.
Parameters:
ctx - the row context to be removed.
Returns:
true if the operation was successful. false otherwise.

removeRowDataFromCollection

public boolean removeRowDataFromCollection(DCRowContext ctx)
This method is to remove the row object (the obj parameter) from the collection. It should not remove the row from the underlying data source.
Parameters:
ctx - the row context to be removed.
Returns:
true if the operation was successful. false otherwise.

resolveAttributeDefs

protected AttributeDef[] resolveAttributeDefs(StructureDef def,
                                              java.lang.String[] attrNames)

applySortCriteria

protected abstract void applySortCriteria(DCIteratorBinding iter,
                                          oracle.jbo.SortCriteria[] sortby)

getSortCriteria

protected abstract oracle.jbo.SortCriteria[] getSortCriteria(DCIteratorBinding iter)

getMethodResults

public java.util.Map getMethodResults()
For looking up method results stored in this DataControl. Application and/or subclasses may cleanup the stored result when the result is no longer needed by calling getMethodResults().remove()

getMethodResultUseCount

public int getMethodResultUseCount(java.lang.Object key)

resetState

public boolean resetState()
Resets the DataControl. DataControl providers should extend this method to reset any model session state that may have been managed by this DataControl. For example:

The ADF/BC DataControl has extended resetState to release the DataControl ApplicationModule to the ApplicationPool in unmanaged release mode.

An EJB DataControl provider may extend resetState to close the DataControl EJB SessionBean

The Toplink DataControl provider extends resetState to reset the DataControl's UnitOfWork and associated RowSetIterators.

Please note that resetState may not occur immediately. If beginRequest has been invoked on the DataControl then resetState processing will be deferred until endRequest processing.

Extending DataControl providers may optionally invoke release(REL_DATA_REFS) after performing and DataControl specific resetState handling.

Specified by:
resetState in interface DCDataControlManagement
Returns:
true if resetState was processed immediately. false if resetState was deferred to endRequest processing.

applyViewCriteria

public abstract void applyViewCriteria(ViewCriteria vc,
                                       DCIteratorBinding iter,
                                       RowSetIterator rsi)
Internal: Applications should not use this method.

getViewCriteria

public ViewCriteria getViewCriteria(DCIteratorBinding iter)
Internal: Applications should not use this method. Return viewCriteria associated with the given iterator binding's collection.

createViewCriteria

public ViewCriteria createViewCriteria(DCIteratorBinding iter)
Internal: Applications should not use this method. Create a new viewCriteria associated with the given iterator binding's collection.

resetAttributeExceptionInRow

protected void resetAttributeExceptionInRow(DCIteratorBinding iter,
                                            Row row,
                                            AttributeDef def,
                                            oracle.jbo.AttrValException ave)

hasPermission

public boolean hasPermission(DCControlBinding binding,
                             java.lang.String target,
                             java.lang.String actions)

hasPermission

public boolean hasPermission(DCControlBinding binding,
                             java.lang.String actions)

hasPermission

public boolean hasPermission(java.security.Permission permission)

getSecurityContext

public oracle.adf.share.security.SecurityContext getSecurityContext()

hasOperationParamsChanged

public boolean hasOperationParamsChanged(OperationInfo info)

cacheMethodResult

protected void cacheMethodResult(DCInvokeMethod method,
                                 java.lang.Object result,
                                 java.lang.Object paramVals)

isBoundRowIteratorEvent

protected boolean isBoundRowIteratorEvent(DCIteratorBinding iter,
                                          oracle.jbo.JboEvent ev)

findVariable

protected oracle.jbo.Variable findVariable(java.lang.String path)

executeIteratorBindingWithParams

public void executeIteratorBindingWithParams(DCIteratorBinding iter,
                                             oracle.adf.model.OperationParameter[] params,
                                             java.lang.Object[] paramVals)

Oracle Application Development Framework Model and Business Components Java API Reference 10.1.3.1.0
B28969-01


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