|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ApplicationModule
An application module is a logical container for coordinated objects related to a particular task with optional programming logic.
Field Summary | |
---|---|
static int |
ACTIVATE_CLIENT_FLAG
|
static int |
ACTIVATE_REMOVE_FLAG
An activation flag. |
static int |
ACTIVATE_SKIP_RESTORE_VO_FROM_DEF
An activation flag. |
static int |
ACTIVATE_TRANSIENT_FLAG
|
static int |
ACTIVATE_UNDO_FLAG
|
static java.lang.String |
DEFAULT_DEF_FULL_NAME
The name of the default application module definition (one that represents oracle.jbo.server.ApplicationModuleDefImpl ). |
static java.lang.String |
DEFAULT_ROOT_APP_MOD_NAME
The default name of root application module. |
static java.lang.String |
EFF_DT_PROPERTY_STR
Used to set the current effective date value as a property value on a root application module. |
static int |
PASSIVATE_DEFER_FLAG
A passivate flag. |
static int |
PASSIVATE_HINT_FLAG
An internal passivation flag. |
static byte |
PASSIVATE_TO_DATABASE
Used by setStoreForPassivate to serialize the state of the application module's session and any cached changes to the database. |
static byte |
PASSIVATE_TO_FILE
Used by setStoreForPassivate to serialize the state of the application module's session and any cached changes to a file. |
static byte |
PASSIVATE_TO_MEMORY
Used by setStoreForPassivate to serialize the state of the application module's session and any cached changes to memory. |
static int |
PASSIVATE_TO_STACK_FLAG
An internal passivation flag. |
static int |
PASSIVATE_TRANSIENT_FLAG
A passivation/activation flag. |
static int |
PASSIVATE_UNDO_FLAG
An internal passivate flag. |
static int |
RELEASE_LEVEL_MANAGED
|
static int |
RELEASE_LEVEL_RESERVED
|
static int |
RELEASE_LEVEL_UNMANAGED
|
static int |
REMOVE_SNAPSHOT
Deprecated. use ACTIVATE_REMOVE_FLAG instead |
static int |
RESET_CLIENT_ONLY_FLAG
May be used to indicate that reset should be performed on the client tier only. |
static int |
RESET_INTERNAL_FLAG
A reset flag. |
static int |
RESET_KEEP_ALL_SNAPSHOTS_FLAG
A reset flag. |
static int |
RESET_MANAGE_SNAPSHOTS
A reset flag. |
static int |
RESET_RELOAD_FLAG
A reset flag. |
static int |
RESET_ROLLBACK_FLAG
A reset flag. |
static int |
SYNC_BATCH
Deprecated. deprecated since 9.0.5. This mode should not be used by client. Batch mode operations should be performed through working set objects instead. |
static int |
SYNC_IMMEDIATE
SYNC_... constants are used to control how often data changes in the client
tier are flushed to the middle tier cache. |
static int |
SYNC_LAZY
SYNC_... constants are used to control how often data changes in the client
tier are flushed to the middle tier cache. |
Method Summary | |
---|---|
ComponentObject |
createComponentObject(java.lang.String name,
java.lang.String defName)
Create the named ComponentObject (e.g. |
ViewObject |
createViewObject(java.lang.String viewName,
java.lang.String defName)
Creates a view object in this application module from the view definition. |
ComponentObject |
findComponentObject(java.lang.String name)
Find the named ComponentObject |
ViewLink |
findViewLink(java.lang.String vlName)
Finds the named view link. |
ViewObject |
findViewObject(java.lang.String viewName)
Finds the named view object. |
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. |
DBTransaction |
getDBTransaction()
Gets this ApplicationModule's database transaction |
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()
Gets the application module's session. |
java.lang.Object |
getSyncLock()
Gets the locking object for this application module. |
Transaction |
getTransaction()
Gets this application module's database transaction. |
void |
sync(SyncOptions options)
Synchronize local database(s) on device with remote database(s) on server. |
java.lang.Object[] |
transformExceptionParams(ViewObject[] vos,
java.lang.String entityName,
java.lang.String exceptionClassName,
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. |
Methods inherited from interface oracle.jbo.ComponentObject |
---|
getDefFullName, getDefName, getFullName, getName, remove |
Methods inherited from interface oracle.jbo.Properties |
---|
getProperties, getProperty, getProperty, refreshProperty |
Methods inherited from interface oracle.jbo.WarningContainer |
---|
addWarning |
Field Detail |
---|
static final java.lang.String DEFAULT_ROOT_APP_MOD_NAME
static final java.lang.String DEFAULT_DEF_FULL_NAME
oracle.jbo.server.ApplicationModuleDefImpl
). This definition object produces
instances of oracle.jbo.server.ApplicationModuleImpl
, which do not have any
custom methods or static component objects.
static final int REMOVE_SNAPSHOT
ACTIVATE_REMOVE_FLAG
instead
static final int PASSIVATE_TRANSIENT_FLAG
#passivateState(byte[], int)
and #activateState(int, SessionData, int)
for
more information.
static final int PASSIVATE_DEFER_FLAG
Setting the flags parameter value to PASSIVATE_DEFER_FLAG
allows the
snapshot creation to be deferred until the application module is checked in. For typical
web-based applications, this means that the snapshot would be created at the end of the
request when the application module checkin is invoked.
Most applications using the application module pool are highly encouraged to use this flag value for performance and memory usage optimization -- deferring the snapshot creation allows one snapshot to be used for both transaction undo and failover support.
Deferred passivation should not be requested if it is necessary to capture the application module state at the time of the undo request -- a deferred undo request does not guarantee that the passivated state equals the application module state at the time of the undo request.
static final int PASSIVATE_UNDO_FLAG
static final int PASSIVATE_HINT_FLAG
static final int PASSIVATE_TO_STACK_FLAG
static final int ACTIVATE_TRANSIENT_FLAG
static final int ACTIVATE_REMOVE_FLAG
static final int ACTIVATE_CLIENT_FLAG
static final int ACTIVATE_UNDO_FLAG
static final int ACTIVATE_SKIP_RESTORE_VO_FROM_DEF
static final int RESET_ROLLBACK_FLAG
static final int RESET_RELOAD_FLAG
static final int RESET_MANAGE_SNAPSHOTS
static final int RESET_KEEP_ALL_SNAPSHOTS_FLAG
static final int RESET_CLIENT_ONLY_FLAG
static final int RESET_INTERNAL_FLAG
Applications may use this flag to determine if the resetState call was made internally or as the result of a lifecycle event. An example of a lifecycle event may be an unmanaged ApplicationPool release or an ApplicationPool recycle event.
static final int RELEASE_LEVEL_MANAGED
static final int RELEASE_LEVEL_RESERVED
static final int RELEASE_LEVEL_UNMANAGED
static final int SYNC_LAZY
SYNC_...
constants are used to control how often data changes in the client
tier are flushed to the middle tier cache. As such, these constants only affect 3 tier mode
and not 2 tier. In 2 tier mode, changes are applied to cache immediately regardless of the
sync mode, i.e., the system effectively runs in the SYNC_IMMEDIATE
mode.
SYNC_LAZY
means that attribute changes are kept in the client tier until an
operation forces changes to be flushed. Examples of such operations are: transaction commit,
the currency movement (next()
, previous()
, ...), etc.
Note that the sync mode is an attribute of the root application module. If one calls
getSyncMode
or setSyncMode
on a nested application module, it is
routed to the root application module. Also, note that pending changes are managed at the root
application module. When the changes are flushed from the client to the middle tier, all
changes pending under the root application module are flushed.
#getSyncMode()
,
#setSyncMode(int)
,
Constant Field Valuesstatic final int SYNC_IMMEDIATE
SYNC_...
constants are used to control how often data changes in the client
tier are flushed to the middle tier cache. As such, these constants only affect 3 tier mode
and not 2 tier. In 2 tier mode, changes are applied to cache immediately regardless of the
sync mode, i.e., the system effectively runs in the SYNC_IMMEDIATE
mode.
SYNC_IMMEDIATE
means that attribute changes from the client tier are applied
(flushed) immediately to the middle tier. to be flushed is issued. Examples of such operations
are: if the transaction is committed, if the currency moves (next()
,
previous()
, ...), if etc.
Note that the sync mode is an attribute of the root application module. If one calls
getSyncMode
or setSyncMode
on a nested application module, it is
routed to the root application module. Also, note that pending changes are managed at the root
application module. When the changes are flushed from the client to the middle tier, all
changes pending under the root application module are flushed.
#getSyncMode()
,
#setSyncMode(int)
,
Constant Field Valuesstatic final int SYNC_BATCH
static final byte PASSIVATE_TO_DATABASE
#setStoreForPassiveState(byte)
,
Constant Field Valuesstatic final byte PASSIVATE_TO_FILE
#setStoreForPassiveState(byte)
,
Constant Field Valuesstatic final byte PASSIVATE_TO_MEMORY
#setStoreForPassiveState(byte)
,
Constant Field Valuesstatic final java.lang.String EFF_DT_PROPERTY_STR
Method Detail |
---|
ViewObject createViewObject(java.lang.String viewName, java.lang.String defName)
defName
parameter.
voName
- the name to be assigned to the view object.defName
- the name of the view definition from which the new view object is to be created. It
must be a fully qualified name (including the package name).
ViewObject findViewObject(java.lang.String viewName)
viewName
- Name of view object to find
java.lang.String[] getLoadedViewObjectNames()
java.lang.String[] getAllViewObjectNames()
ComponentObject createComponentObject(java.lang.String name, java.lang.String defName)
name
- Name of the objectdefName
- Full name of the object's definition
ComponentObject findComponentObject(java.lang.String name)
name
- Name of the object
DBTransaction getDBTransaction()
Session getSession()
If the user creates two root application modules, each has its own session.
Note that this is the same session that is passed to the
oracle.jbo.server.ApplicationModuleImpl#activate(Session)
call.
java.lang.IllegalStateException
- if no root application module is found. This could happen if the user calls this
method on an application module that has been removed or has not fully been
initialized.oracle.jbo.server.ApplicationModuleImpl#activate(Session)
java.lang.Object getSyncLock()
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. }
java.lang.Object[] transformExceptionParams(ViewObject[] vos, java.lang.String entityName, java.lang.String exceptionClassName, java.lang.Object[] params)
vos
- an array of possible view objects.entityName
- fully qualified name of the entity object. Should not be null
.exceptionClassName
- Qualified classname for the Exception which is being mappedparams
- Parameters from the Exception that is to be transformed into view object equivalents.
NoDefException
- if the entity could not be found.
PersistenceException
- if some error was found while loading the entity definition.Transaction getTransaction()
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.
java.lang.IllegalStateException
- if no root application module is found. This could happen if the user calls this
method on an application module that has been removed or has not fully been
initialized.ViewLink findViewLink(java.lang.String vlName)
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");
vlName
- the name of the view link.
null
if the view link is not found.
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.#findApplicationModule(String)
,
findViewObject(String)
void sync(SyncOptions options)
options
-
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |