Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.jbo.server
Class ApplicationModuleImpl

java.lang.Object
  extended by oracle.jbo.server.NamedObjectImpl
      extended by oracle.jbo.server.ComponentObjectImpl
          extended by oracle.jbo.server.ContainerObjectImpl
              extended by oracle.jbo.server.ApplicationModuleImpl
All Implemented Interfaces:
Formattable, ApplicationModule, ComponentObject, Properties, ContainerObject, TransactionListener, VariableManagerOwner, VariableManagerOwnerBase, WarningContainer

public class ApplicationModuleImpl
extends ContainerObjectImpl
implements ApplicationModule, TransactionListener

An ApplicationModule is a logical container for coordinated objects related to a particular task, with optional programming logic


Field Summary
static java.lang.Class CLASS_INSTANCE
           
static java.lang.String DEFAULT_DEF_NAME
          Default Def name for Application Module.
 
Fields inherited from class oracle.jbo.server.ContainerObjectImpl
mComponentList, mComponents
 
Fields inherited from class oracle.jbo.server.NamedObjectImpl
mObjName, mParent, mProperties, mUserData, RES_ID_SUFFIX
 
Fields inherited from interface oracle.jbo.ApplicationModule
ACTIVATE_CLIENT_FLAG, ACTIVATE_REMOVE_FLAG, ACTIVATE_SKIP_RESTORE_VO_FROM_DEF, ACTIVATE_TRANSIENT_FLAG, ACTIVATE_UNDO_FLAG, DEFAULT_DEF_FULL_NAME, DEFAULT_ROOT_APP_MOD_NAME, EFF_DT_PROPERTY_STR, PASSIVATE_DEFER_FLAG, PASSIVATE_HINT_FLAG, PASSIVATE_TO_DATABASE, PASSIVATE_TO_FILE, PASSIVATE_TO_MEMORY, PASSIVATE_TO_STACK_FLAG, PASSIVATE_TRANSIENT_FLAG, PASSIVATE_UNDO_FLAG, RELEASE_LEVEL_MANAGED, RELEASE_LEVEL_RESERVED, RELEASE_LEVEL_UNMANAGED, REMOVE_SNAPSHOT, RESET_CLIENT_ONLY_FLAG, RESET_INTERNAL_FLAG, RESET_KEEP_ALL_SNAPSHOTS_FLAG, RESET_MANAGE_SNAPSHOTS, RESET_RELOAD_FLAG, RESET_ROLLBACK_FLAG, SYNC_BATCH, SYNC_IMMEDIATE, SYNC_LAZY
 
Constructor Summary
ApplicationModuleImpl()
           
 
Method Summary
 byte[] activateState(int id, SessionData info, int flags)
           
 byte[] activateStateForUndo(java.lang.String id, int flags)
           
protected  void addChild(ComponentObjectImpl object)
          Internal: Applications should not use this method.
 void addWarning(JboWarning warn)
          Specifies the name of the handler that will perform special processing of warnings on the client.
 void afterCommit(TransactionEvent e)
          Called to report that a Commit operation has occurred.
protected  void afterConnect()
          Invoked after the application module database connection has been established.
 void afterRemove(TransactionEvent e)
          A cleanup routine to be invoked by transaction manager when this transaction listener is removed from the manager's list.
 void afterRollback(TransactionEvent e)
          Called to report that a Rollback operation has occurred.
protected  void afterValidate(TransactionEvent te)
          Callback from the transaction after completing a validation iteration.
 void beforeCommit(TransactionEvent e)
          Called to report that a Commit operation is imminent.
protected  void beforeDisconnect()
          Invoked before the application module database connection has been released.
 void beforeRollback(TransactionEvent e)
          Called to report that a Rollback operation is imminent.
 void beforeSyncStart(SyncSession session)
           
protected  void beforeValidate(TransactionEvent te)
          Callback from the transaction before starting a validation iteration.
 void clearVOCaches(java.lang.String entityName, boolean recurse)
          Clears the caches of all View Objects that use the specified entity.
static ApplicationModuleImpl createRootApplicationModule(java.lang.String defName)
           
 ViewLink createViewLink(java.lang.String viewLinkName, ViewLinkDefImpl info, ViewObject master, ViewObject detail, boolean checkName)
          Internal: Applications should not call this method.
 ViewObject createViewObject(java.lang.String voName, java.lang.String vDefName)
          Creates an updateable View Object.
protected  ViewObject createViewObject(java.lang.String voName, ViewDefImpl viewDef)
           
 ViewObject createViewObjectFromQueryClauses(java.lang.String voName, java.lang.String eoName, java.lang.String selectClause, java.lang.String fromClause, java.lang.String whereClause, java.lang.String orderByClause)
          Creates an updateable View Object.
 ViewObject createViewObjectOnEntity(java.lang.String voName, java.lang.String eoName)
           
 ApplicationModule findApplicationModule(java.lang.String amName)
          Finds the named Application Module.
static ApplicationModuleImpl findOrCreateAppModule(java.lang.String defName)
           
 ViewLink findViewLink(java.lang.String vlName)
          Finds the named View Link.
 ViewObject findViewObject(java.lang.String voName)
          Finds the named View Object.
 ViewObject findViewObjectUsingEntity(ViewObject[] vos, java.lang.String eoName, java.lang.String[] attrNames)
           
 void findVOsWithEntityUsage(java.lang.String entityName, boolean recurse, java.util.Vector vos)
           
 java.lang.String[] getAllViewObjectNames()
          Returns an array of the names of all the view objects this app module knows about, including ones that have not been loaded.
 ApplicationModuleDefImpl getApplicationModuleDef()
           
 ApplicationModuleImpl[] getApplicationModuleImpls()
          Internal: Applications should not use this method.
 DBTransaction getDBTransaction()
          Gets this ApplicationModule's database transaction
 Row getEntityRowFromHandle(int eRowHandle)
          Internal: Applications should not use this method.
 RowSetIterator getListBindingRSI(RowSetIterator rsi, Key rowKey, java.lang.String attrName, java.lang.String lbName)
           
 java.lang.String[] getLoadedViewObjectNames()
          Returns an array of the names of all the view objects that have been loaded into this app module thus far.
 Session getSession()
          Returns the session information.
 java.lang.Object getSyncLock()
          Gets the locking object for this application module.
 Transaction getTransaction()
          Gets this application module's database transaction.
 ViewLinkImpl[] getViewLinks()
           
 ViewObject[] getViewObjects()
          Constructs an array of this Application Module's View Objects.
 boolean isForRemote()
           
 boolean isLoadComponentsLazily()
           
 boolean isNameGenerated()
           
 boolean isRoot()
           
 boolean isTransientTransactionListener()
          Tests whether this transaction listener is transient or permanent.
 java.lang.String passivateStateForUndo(java.lang.String id, byte[] clientData, int flags)
           
 void remove()
          Deletes this component.
protected  void removeChild(ComponentObjectImpl object)
          Internal: Applications should not use this method.
protected  void reset()
          BC4J invokes this method when a ApplicationModule is being reset for potential reuse by another client session.
 void resetState(boolean reload)
           
 void resetState(int flags)
           
 void setExceptionHandler(JboExceptionHandler hndlr)
          Specifies the name of the handler which will perform special processing of the exceptions on the client.
 void setLoadComponentsLazily(boolean value)
           
 void setRemoteAdapter(ApplicationModuleRemoteAdapter adapter)
           
 void sync(SyncOptions options)
          Synchronize local database(s) on device with remote database(s) on server.
 java.lang.Object[] transformExceptionParams(ViewObject[] inVOs, java.lang.String entityDefName, java.lang.String className, java.lang.Object[] params)
          Internal: Applications should not use this method. This method uses findViewObjectUsingEntity() to get the first view object that this entity is used in and then transforms the parameters from a given JboException from their entity layer equivalents to the view object equivalents.
protected  java.lang.Object[] transformExceptionParams(ViewObject vo, java.lang.String entityDefName, java.lang.String className, java.lang.Object[] params)
          Internal: Applications should not call this method.
 
Methods inherited from class oracle.jbo.server.ContainerObjectImpl
addContainerListener, createComponentObject, findComponentObject, removeContainerListener
 
Methods inherited from class oracle.jbo.server.ComponentObjectImpl
addListener, applyPersonalization, create, createRef, ensureVariableManager, getAllProperties, getApplicationModule, getCompListeners, getCompListenersList, getDefFullName, getDefName, getMessageBundleClass, getResourceBundleDef, getRootApplicationModule, getVariableManager, hasVariables, isDead, resolvePropertyRaw
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
formatChildCollectionForOutput, formatChildCollectionForOutput, formatChildCollectionForOutput, formatForOutput, formatForOutput, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getResourcesFromBundle, getUserData, parseAttrArrayElements, refreshProperty, requiresNamePrefixedResId, setFullName, setName, setParent, setPropertiesMap, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.ApplicationModule
createComponentObject, findComponentObject
 
Methods inherited from interface oracle.jbo.ComponentObject
getDefFullName, getDefName, getFullName, getName
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 
Methods inherited from interface oracle.jbo.VariableManagerOwner
getName
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

DEFAULT_DEF_NAME

public static final java.lang.String DEFAULT_DEF_NAME
Default Def name for Application Module.

Constructor Detail

ApplicationModuleImpl

public ApplicationModuleImpl()
Method Detail

findOrCreateAppModule

public static ApplicationModuleImpl findOrCreateAppModule(java.lang.String defName)

createRootApplicationModule

public static ApplicationModuleImpl createRootApplicationModule(java.lang.String defName)

getApplicationModuleDef

public ApplicationModuleDefImpl getApplicationModuleDef()

createViewObject

public ViewObject createViewObject(java.lang.String voName,
                                   java.lang.String vDefName)
Creates an updateable View Object.

This method is useful for instantiating View Objects within a generic Application Module, but you can use it with any Application Module. The code calls createViewObject, passing in the name of the View Object metadata (that is, the name you provided for the View Object at design time) that defines the View Object and a View instance name to identify this instance. You can use this View instance name to find the View Object later, if needed.

 // Specify the Java file that defines the View Object.
 // Format: package.filename
 String voDefFile = "d2e.DeptView";

 // Identify the View Object. Must be a valid Java identifier.
 String voName = "demoDeptVO";

 // Create the View Object within the context defined by the
 // Application Module.
 ViewObject vo = appMod.createViewObject(voName, voDefFile);
 

Specified by:
createViewObject in interface ApplicationModule
Parameters:
voName - the name to be given to the View Object. If empty, a name is generated.
vDefName - a view definition.
Returns:
a new View Object.
Throws:
InvalidObjNameException - if voName is invalid.
NoObjException - if voName does not exist.

createViewObject

protected ViewObject createViewObject(java.lang.String voName,
                                      ViewDefImpl viewDef)

findViewObject

public ViewObject findViewObject(java.lang.String voName)
Finds the named View Object. The View Object name passed in (voName) may or may not be qualified with the name of the containing Application Module. If it is, the View Object name is said to be an AM-qualified View Object name. If not, the name is said to be an unqualified View Object name.

An AM-qualified name is a multi-part name (separated by dots). The last part of the name is the View Object name (View Object part of the name). All preceding parts consistitute the name of the Application Module that contains the View Object. For an AM-qualified name, findViewObject() first locates the containing Application Module using the Application Module name. In fact, it uses findApplicationModule(String) to find the Application Module. Thus, the Application Module name in an AM-qualified View Object name may be relative or absolute Application Module name. See findApplicationModule() discussions on absolute and relative Application Module names. Once the Application Module is found, the View Object part is used to find the View Object in that Application Module.

If the View Object name is unqualified, the search for the View Object is made on this Application Module.

For example, suppose we have the following containership of nested Application Modules and View Objects:

    Root (root Application Module)
       ChildAM1
          ViewObjectA
          GrandChildAM1_1
             ViewObjectB
          GrandChildAM1_2
             GreatGrandChildAM1_2_1
                ViewObjectC
       ChildAM2
          GrandChildAM2_1
             ViewObjectD
 

ChildAM1.findViewObject("GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewObjectC") will succeed (using relative Application Module name).

ChildAM2.findViewObject("Root.ChildAM1.GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewObjectC") will succeed (using absolute Application Module name) and return the same View Object as ChildAM1.findViewObject("GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewObjectC").

Both these are AM-qualified name cases.

GrandChildAM2_1.findViewObject("ViewObjectD") will succeed. This is is an unqualified name case.

For View Object searching, findViewObject() makes no distinction between View Objects included the Application Module during design time and those created programmatically during runtime.

Example code:

 ViewObject vo = am.findViewObject("MyVO");
 

Specified by:
findViewObject in interface ApplicationModule
Parameters:
voName - the name of the View Object.
Returns:
the View Object. null if the View Object is not found.
Throws:
NoObjException - if an AM-qualified name was specified and the containing Application Module could not be found.
InvalidObjNameException - if voName is an invalid name. voName must be a vaild Java name.
See Also:
findApplicationModule(String), findViewLink(String)

getAllViewObjectNames

public java.lang.String[] getAllViewObjectNames()
Description copied from interface: ApplicationModule
Returns an array of the names of all the view objects this app module knows about, including ones that have not been loaded.

Specified by:
getAllViewObjectNames in interface ApplicationModule
Returns:
An array of view object names. If no view objects are found, will return an empty array.

getLoadedViewObjectNames

public java.lang.String[] getLoadedViewObjectNames()
Description copied from interface: ApplicationModule
Returns an array of the names of all the view objects that have been loaded into this app module thus far. Does NOT include ViewObject's that have not been loaded.

Specified by:
getLoadedViewObjectNames in interface ApplicationModule
Returns:
An array of view object names. If no view objects are found, will return an empty array.

getDBTransaction

public DBTransaction getDBTransaction()
Description copied from interface: ApplicationModule
Gets this ApplicationModule's database transaction

Specified by:
getDBTransaction in interface ApplicationModule
Returns:
The associated DBTransaction

getTransaction

public Transaction getTransaction()
Description copied from interface: ApplicationModule
Gets this application module's database transaction. Note that if this method is invoked on a nested application module, the root application module's transaction is returned. This is because the transaction is shared by all application modules contained by the root application module.

If the user creates two root application modules, they normally do not share the transaction. To share a transaction acroos root application modules, the user would need to define a global transaction through JTA and have both application modules participate in it.

Specified by:
getTransaction in interface ApplicationModule
Returns:
the transaction.

remove

public void remove()
Description copied from class: ComponentObjectImpl
Deletes this component.

Specified by:
remove in interface ComponentObject
Overrides:
remove in class ComponentObjectImpl

isRoot

public boolean isRoot()

isLoadComponentsLazily

public boolean isLoadComponentsLazily()

setLoadComponentsLazily

public void setLoadComponentsLazily(boolean value)

getSession

public Session getSession()
Returns the session information. Whenever a client connects to a middle tier server, a session is created. Note, this is the same session that is passed in the activate call.

Specified by:
getSession in interface ApplicationModule
Returns:
the session.
Throws:
java.lang.IllegalStateException - if the session information cannot be found.
See Also:
#activate(Session)

getSyncLock

public final java.lang.Object getSyncLock()
Description copied from interface: ApplicationModule
Gets the locking object for this application module. Note that if this method is invoked on a nested application module, the root application module's locking object is returned. This is because the locking object is shared by all application modules contained by the root application module.

This locking object should be used to synchronize multiple calls into BC4J. The client application code rarely needs to worry about synchronization. It is the middle tier (the server) code that needs to synchronize calls into the middle tier to serialize updates to shared middle tier objects.

Here is an example of how to synchronize access using this method:

 synchronized (am.getSyncLock())
 {
   // Code that needs to execute serially.
 }
 

Specified by:
getSyncLock in interface ApplicationModule
Returns:
the locking object.

createViewObjectOnEntity

public ViewObject createViewObjectOnEntity(java.lang.String voName,
                                           java.lang.String eoName)

transformExceptionParams

protected java.lang.Object[] transformExceptionParams(ViewObject vo,
                                                      java.lang.String entityDefName,
                                                      java.lang.String className,
                                                      java.lang.Object[] params)
Internal: Applications should not call this method.


setExceptionHandler

public void setExceptionHandler(JboExceptionHandler hndlr)
Specifies the name of the handler which will perform special processing of the exceptions on the client.

In typical use in three tier mode, a user enters values at the client. A user response, such as pressing the Return key or a Submit button, pushes the values to the server. The values are applied to the Entities and validated. Any exceptions that are thrown, are collected and shipped back to the client. Typically, exceptions are given, one-by-one, to the client. Instead, a handler can be specified to perform special processing of the exceptions.

Parameters:
hndlr - an exception handler.

addWarning

public void addWarning(JboWarning warn)
Specifies the name of the handler that will perform special processing of warnings on the client.

Specified by:
addWarning in interface WarningContainer
Parameters:
warn - a warning.

transformExceptionParams

public java.lang.Object[] transformExceptionParams(ViewObject[] inVOs,
                                                   java.lang.String entityDefName,
                                                   java.lang.String className,
                                                   java.lang.Object[] params)
Description copied from interface: ApplicationModule
Internal: Applications should not use this method. This method uses findViewObjectUsingEntity() to get the first view object that this entity is used in and then transforms the parameters from a given JboException from their entity layer equivalents to the view object equivalents. This method is primarily used by JboException subclasses to map their parameters when doEntityToVOMapping() is called on those Exceptions.

Specified by:
transformExceptionParams in interface ApplicationModule
Parameters:
inVOs - an array of possible view objects.
entityDefName - fully qualified name of the entity object. Should not be null.
className - Qualified classname for the Exception which is being mapped
params - Parameters from the Exception that is to be transformed into view object equivalents.

findViewObjectUsingEntity

public ViewObject findViewObjectUsingEntity(ViewObject[] vos,
                                            java.lang.String eoName,
                                            java.lang.String[] attrNames)

activateStateForUndo

public byte[] activateStateForUndo(java.lang.String id,
                                   int flags)

activateState

public byte[] activateState(int id,
                            SessionData info,
                            int flags)

findVOsWithEntityUsage

public void findVOsWithEntityUsage(java.lang.String entityName,
                                   boolean recurse,
                                   java.util.Vector vos)

getViewObjects

public ViewObject[] getViewObjects()
Constructs an array of this Application Module's View Objects. The following example uses this method to remove the View Objects contained in the Application Module:

 ViewObject[] vos = yourAM.getViewObjects();
 for (j = 0; j < vos.length; j++)
 {
   vos[j].remove();
 }
 

Returns:
the array of View Objects contained by this Application Module.

createViewObjectFromQueryClauses

public ViewObject createViewObjectFromQueryClauses(java.lang.String voName,
                                                   java.lang.String eoName,
                                                   java.lang.String selectClause,
                                                   java.lang.String fromClause,
                                                   java.lang.String whereClause,
                                                   java.lang.String orderByClause)
Creates an updateable View Object.

Use this method to build a View Object from SQL clauses. The View Object can be based on an Entity Object. For example, the following statement creates a View Object from attributes of the EMP Entity Object. Attributes related to EMP (such as E.ENAME) are updateable.

   ViewObject v = appMod.createViewObjectFromQueryClauses("xyz",
         "demo.hr.EMP",       // The one updateable Entity Object Name
         "E.ENAME, E.EMPNO",  // select clause
         "EMP E",             // from clause
         "E.DEPTNO = 10",     // where clause
          null);              // order by clause
 

Parameters:
voName - the name to be given to the View Object. If empty, a name is generated.
eoName - the name of the Entity Object from which the View Object is to be derived.
selectClause - a SQL statement SELECT clause.
fromClause - a SQL statement FROM clause.
whereClause - a SQL statement WHERE clause.
orderByClause - a SQL statement ORDERBY clause.
Returns:
a new View Object.
Throws:
InvalidParamException - if voName is invalid.
NameClashException - if voName already exists.

getApplicationModuleImpls

public ApplicationModuleImpl[] getApplicationModuleImpls()
Internal: Applications should not use this method.

Creates an array of Application Modules.

Returns:
the array of Application Modules.

isForRemote

public boolean isForRemote()

setRemoteAdapter

public void setRemoteAdapter(ApplicationModuleRemoteAdapter adapter)

passivateStateForUndo

public java.lang.String passivateStateForUndo(java.lang.String id,
                                              byte[] clientData,
                                              int flags)

beforeValidate

protected void beforeValidate(TransactionEvent te)
Callback from the transaction before starting a validation iteration. Transaction will call this hook on the root application module. The root application module in turn will call the beforeValidate method on all its children

Parameters:
te - a transaction event.

afterValidate

protected void afterValidate(TransactionEvent te)
Callback from the transaction after completing a validation iteration. Transaction will call this hook on the root application module. The root application module in turn will call the afterValidate method on all its children

Parameters:
te - a transaction event.

findApplicationModule

public ApplicationModule findApplicationModule(java.lang.String amName)
Finds the named Application Module. The Application Module name passed in (amName) may be a single part name or a multi-part name. If it is multi-part (separated by dots), each part from left represents the containing (parent) Application Module.

Based on the name, findApplicationModule first tries to find the nested Application Module starting with this Application Module. If it finds a match, it returns it. In this case, the name is said to be relative.

If it does not find a match, it starts searching for the Application Module from the root Application Module. If it finds a match, it returns it. In this case, the name is said to be absolute.

For example, suppose we have the following containership of nested Application Modules:

    Root (root Application Module)
       ChildAM1
          GrandChildAM1_1
          GrandChildAM1_2
             GreatGrandChildAM1_2_1
       ChildAM2
          GrandChildAM2_1
 

If one calls findApplicationModule("GrandChildAM1_2") on ChildAM1, it will find it from ChildAM1 and return it.

If one calls findApplicationModule("GrandChildAM1_2.GreatGrandChildAM1_2_1") on ChildAM1, it will find it from ChildAM1 and return it.

Both these are relative name cases.

If one calls findApplicationModule("Root.ChildAM2.GrandChildAM2_1") on ChildAM1, it will first try to find it from ChildAM1. This will fail because ChildAM1 does not have a nested Application Module named Root. After that, the search begins from the root Application Module. This will succeed because Root has a nested Application Module named ChildAM2 and ChildAM2 in turn has a nested nested Application Module named GrandChildAM2_1. This is an absolute name case.

For Application Module searching, findApplicationModule() makes no distinction between nested Application Modules included in other Application Modules during design time and those created programmatically during runtime.

Example code:

 ApplicationModule nestedAM = parentAM.findApplicationModule("MyNestedAM");
 

Parameters:
amName - the name of the nested Application Module. It may be a relative name or an absolute name. If null, the root Application Module is returned.
Returns:
the nested Application Module. null if the Application Module is not found.
Throws:
InvalidObjNameException - if amName is an invalid name. amName must be a vaild Java name.

findViewLink

public ViewLink findViewLink(java.lang.String vlName)
Finds the named View Link. The View Link name passed in (vlName) may or may not be qualified with the name of the containing Application Module. If it is, the View Link name is said to be an AM-qualified View Link name. If not, the name is said to be an unqualified View Link name.

An AM-qualified name is a multi-part name (separated by dots). The last part of the name is the View Link name (View Link part of the name). All preceding parts consistitute the name of the Application Module that contains the View Link. For an AM-qualified name, findViewLink() first locates the containing Application Module using the Application Module name. In fact, it uses findApplicationModule(String) to find the Application Module. Thus, the Application Module name in an AM-qualified View Link name may be relative or absolute Application Module name. See findApplicationModule() discussions on absolute and relative Application Module names. Once the Application Module is found, the View Link part is used to find the View Link in that Application Module.

If the View Link name is unqualified, the search for the View Link is made on this Application Module.

For example, suppose we have the following containership of nested Application Modules and View Links:

    Root (root Application Module)
       ChildAM1
          ViewLinkA
          GrandChildAM1_1
             ViewLinkB
          GrandChildAM1_2
             GreatGrandChildAM1_2_1
                ViewLinkC
       ChildAM2
          GrandChildAM2_1
             ViewLinkD
 

ChildAM1.findViewLink("GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewLinkC") will succeed (using relative Application Module name).

ChildAM2.findViewLink("Root.ChildAM1.GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewLinkC") will succeed (using absolute Application Module name) and return the same View Link as ChildAM1.findViewLink("GrandChildAM1_2.GreatGrandChildAM1_2_1.ViewLinkC").

Both these are AM-qualified name cases.

GrandChildAM2_1.findViewLink("ViewLinkD") will succeed. This is is an unqualified name case.

For View Link searching, findViewLink() makes no distinction between View Links included the Application Module during design time and those created programmatically during runtime.

Example code:

    ViewLink vl = am.findViewLink("MyVL");
 

Specified by:
findViewLink in interface ApplicationModule
Parameters:
vlName - the name of the View Link.
Returns:
the View Link. null if the View Link is not found.
Throws:
NoObjException - if an AM-qualified name was specified and the containing Application Module could not be found.
InvalidObjNameException - if vlName is an invalid name. vlName must be a vaild Java name.
See Also:
findApplicationModule(String), findViewObject(String)

getEntityRowFromHandle

public Row getEntityRowFromHandle(int eRowHandle)
Internal: Applications should not use this method.


addChild

protected void addChild(ComponentObjectImpl object)
Internal: Applications should not use this method.

Adds names to this Application Module's own list of child components. The child components can be View Objects, View Links, or other Application Modules. This method overrides an internal addChild method in NamedObjectImpl.

Parameters:
object - an object to add to the component list.
See Also:
NamedObjectImpl

beforeCommit

public void beforeCommit(TransactionEvent e)
Description copied from interface: TransactionListener
Called to report that a Commit operation is imminent.

Specified by:
beforeCommit in interface TransactionListener
Parameters:
e - a transaction event.

beforeRollback

public void beforeRollback(TransactionEvent e)
Description copied from interface: TransactionListener
Called to report that a Rollback operation is imminent.

Specified by:
beforeRollback in interface TransactionListener
Parameters:
e - a transaction event.

afterCommit

public void afterCommit(TransactionEvent e)
Description copied from interface: TransactionListener
Called to report that a Commit operation has occurred.

Specified by:
afterCommit in interface TransactionListener
Parameters:
e - a transaction event.

afterRollback

public void afterRollback(TransactionEvent e)
Description copied from interface: TransactionListener
Called to report that a Rollback operation has occurred.

Specified by:
afterRollback in interface TransactionListener
Parameters:
e - a transaction event.

afterRemove

public void afterRemove(TransactionEvent e)
Description copied from interface: TransactionListener
A cleanup routine to be invoked by transaction manager when this transaction listener is removed from the manager's list.

Specified by:
afterRemove in interface TransactionListener
Parameters:
e - a transaction event.

isTransientTransactionListener

public boolean isTransientTransactionListener()
Description copied from interface: TransactionListener
Tests whether this transaction listener is transient or permanent.

Transient listeners are automatically removed at the end of a transaction commit or rollback cycle; permanent listeners remain across these cycles.

Specified by:
isTransientTransactionListener in interface TransactionListener
Returns:
true if the listener is transient.

afterConnect

protected void afterConnect()
Invoked after the application module database connection has been established. This method may be overriden by applications to perform application module initialization which requires database access.


getListBindingRSI

public RowSetIterator getListBindingRSI(RowSetIterator rsi,
                                        Key rowKey,
                                        java.lang.String attrName,
                                        java.lang.String lbName)

removeChild

protected void removeChild(ComponentObjectImpl object)
Internal: Applications should not use this method.

Removes names from this Application Module's own list of child components. The child components can be View Objects, View Links, or other Application Modules. This method overrides an internal removeChild method in NamedObjectImpl.

Parameters:
object - an object to remove from the component list.
See Also:
NamedObjectImpl

createViewLink

public ViewLink createViewLink(java.lang.String viewLinkName,
                               ViewLinkDefImpl info,
                               ViewObject master,
                               ViewObject detail,
                               boolean checkName)
Internal: Applications should not call this method.

Creates a View Link, given the View Link name, the Def name, and the names of the master and detail View Objects. You can use this method to dynamically create View Links.

For example, assume that during design time, you used the Design-Time View Object Wizard to create two View Objects, DeptVO and EmpVO inside of a package named package1. Then, assume that you invoked the View Link Wizard from the package node to create a View Link Definition named MyViewLinkDef, that links DeptVO and EmpVO in a master-detail relationship.

Given that you have the names of the View Link Definition and the master and detail View Objects, you can provide code such as the following that executes during runtime and creates a View Link named MyLink1:

 ViewObject voDept = myAM.createViewObject("MyDept", "package1.DeptVO");
 ViewObject voEmp = myAM.createViewObject("MyEmp", "package1.EmpVO");
 ViewLink vl = myAM.createViewLink("MyLink1", "package1.MyViewLinkDef",
                voDept, voEmp);
 

This will set up a master-detail relationship between the voDept and the voEmp.

Parameters:
viewLinkName - the name to be given to the View Link. If empty, a name is generated.
info - the definition to be used to create the link.
master - the link's source View Object.
detail - the link's destination View Object.
checkName - whether to verify uniqueness of viewLinkName.
Throws:
InvalidParamException - if master or detail are invalid.
InvalidObjNameException - if viewLinkName is invalid.
NameClashException - if viewLinkName already exists.

beforeDisconnect

protected void beforeDisconnect()
Invoked before the application module database connection has been released. This method may be overriden by applications to cleanup any database state which may have been created by afterConnect.


reset

protected void reset()
BC4J invokes this method when a ApplicationModule is being reset for potential reuse by another client session. Custom applications may extend this method to clean up custom ApplicationModule state that was specific to the last session to use this ApplicationModule.

Examples of session ApplicationModule state include custom instance variables.

See Also:
resetState(boolean)

resetState

public void resetState(boolean reload)

resetState

public void resetState(int flags)

clearVOCaches

public void clearVOCaches(java.lang.String entityName,
                          boolean recurse)
Clears the caches of all View Objects that use the specified entity. This method finds all View Objects that use the entity, then calls clearCache() on each View Object.

If entityName is null, then the caches of all View Objects in the Application Module are cleared. If recurse is true, it recurses into nested (child) Application Modules.

Parameters:
entityName - name of the Entity Object that the View Objects use. Can be null.
recurse - true recurses to (child) Application Modules; false applies this method only to the top-level Application Module.
See Also:
oracle.jbo.ViewObject#clearCache()

getViewLinks

public ViewLinkImpl[] getViewLinks()

isNameGenerated

public final boolean isNameGenerated()

sync

public void sync(SyncOptions options)
Description copied from interface: ApplicationModule
Synchronize local database(s) on device with remote database(s) on server.

Specified by:
sync in interface ApplicationModule

beforeSyncStart

public void beforeSyncStart(SyncSession session)

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.