Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

oracle.adfmf.framework.api
Class Model

Object
  extended by oracle.adfmf.framework.api.Model

public class Model
extends Object

Public services used by the UI framework to assist in the more common functions.


Constructor Summary
Model()
           
 
Method Summary
 void addBeanDefinition(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition def)
          Add a bean definition to the current context.
static void addMonitorObservation(String monitorId, double duration)
           
static void addMonitorObservation(String monitorId, String description, double duration)
           
static void addMonitorObservations(oracle.adfmf.json.JSONArray array)
           
static RestServiceAdapter createRestServiceAdapter()
          Get an empty REST service adapter object.
static void deviceIsReady()
          Signals device is ready
 Object evaluateMethodExpression(String expression, oracle.adfmf.json.JSONArray params, String returnType, String[] paramTypes)
          Evaluate the method expression passed in.
 String fetchAmxPage(String page)
          Return an amx file as a String from the given path.
 String getContextId()
          Get the current context id
 String getContextInstanceId()
          Get the current context instance id
 String getContextPageDef()
          Get the current context page definition
 String[] getModelInventory()
          Get the list of model's methods.
 oracle.adfmf.framework.contract.adf.NameValuePair[] getValue(String[] variables)
          Get a set of values from their passed in EL expressions.
static void loadBundle(AdfELContext context, String baseName, String variable)
          Load the given resource bundle
 void loadBundle(String baseName, String variable)
          Load the given resource bundle
static Class loadClassObj(String name)
          Internal helper function to load classes in the current class loader.
 String ping()
          A simple ping test used to ensure the VM is up and functioning correctly.
 void popPageFlowScope()
          Pops a page flow and moves frame pointer down in the stack
 Object[] processBatchRequests(Boolean abortOnError, oracle.adfmf.json.JSONObject[] requests)
          process the set of request as a batch.
 void pushPageFlowScope()
          Pushes a new page flow and creates a new frame pointer.
 void removeBeanDefinition(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition def)
          Remove a bean definition from the current context.
 void removeContext(String contextKey, String instanceId)
          Remove the context from the collection of contexts
 void removeContextInstance(String contextKey, String instanceId)
          Remove the context from the collection of contexts
 void resetFeature()
          Reset the current feature.
 void setBeanDefinitions(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition[] defs)
          Set the bean definitions into the current context - Clears all currently registered definitions.
 String[] setContext(String contextKey)
          Set the context
 String[] setContextInstance(String contextKey, String instanceId, boolean resetState, boolean reSync)
          Set the context
 oracle.adfmf.framework.contract.adf.NameValuePair[] setValue(oracle.adfmf.framework.contract.adf.NameValuePair[] data)
          Set a set of EL values
static void waitForDeviceReady()
          Wait for device is ready
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Model

public Model()
Method Detail

loadClassObj

public static Class loadClassObj(String name)
                          throws ClassNotFoundException
Internal helper function to load classes in the current class loader.

Parameters:
name - class name
Returns:
Class object
Throws:
ClassNotFoundException

ping

public String ping()
A simple ping test used to ensure the VM is up and functioning correctly.


pushPageFlowScope

public void pushPageFlowScope()
Pushes a new page flow and creates a new frame pointer.


popPageFlowScope

public void popPageFlowScope()
Pops a page flow and moves frame pointer down in the stack


getModelInventory

public String[] getModelInventory()
Get the list of model's methods. Used for introspecting purposes.


processBatchRequests

public Object[] processBatchRequests(Boolean abortOnError,
                                     oracle.adfmf.json.JSONObject[] requests)
process the set of request as a batch. We determine if we should stop processing (abort the batch) on error or not. Please note, that error really relates to catastrophic exceptions and not simply softer that the request simply failed to do an error.

Parameters:
abortOnError -
requests -
Returns:
array of results (1-1 with the requests)

resetFeature

public void resetFeature()
                  throws AdfException
Reset the current feature.

Throws:
AdfException

getValue

public oracle.adfmf.framework.contract.adf.NameValuePair[] getValue(String[] variables)
                                                             throws AdfException
Get a set of values from their passed in EL expressions.

Parameters:
variables - an array of EL expressions
Returns:
an array of the EL values
Throws:
AdfException

setValue

public oracle.adfmf.framework.contract.adf.NameValuePair[] setValue(oracle.adfmf.framework.contract.adf.NameValuePair[] data)
                                                             throws AdfException
Set a set of EL values

Parameters:
data - an array of NameValuePairs (EL expression, value)
Returns:
an array of NameValuePairs (EL expression, value)
Throws:
AdfException

evaluateMethodExpression

public Object evaluateMethodExpression(String expression,
                                       oracle.adfmf.json.JSONArray params,
                                       String returnType,
                                       String[] paramTypes)
                                throws AdfException
Evaluate the method expression passed in.

Parameters:
expression - method expression
params - to the method
returnType - of the method
paramTypes - of the method
Returns:
the result of executing the method with the given parameters
Throws:
AdfException

getContextId

public String getContextId()
                    throws AdfException
Get the current context id

Throws:
AdfException

getContextPageDef

public String getContextPageDef()
                         throws AdfException
Get the current context page definition

Throws:
AdfException

getContextInstanceId

public String getContextInstanceId()
                            throws AdfException
Get the current context instance id

Throws:
AdfException

removeContext

public void removeContext(String contextKey,
                          String instanceId)
                   throws AdfException
Remove the context from the collection of contexts

Throws:
AdfException

removeContextInstance

public void removeContextInstance(String contextKey,
                                  String instanceId)
                           throws AdfException
Remove the context from the collection of contexts

Throws:
AdfException

fetchAmxPage

public String fetchAmxPage(String page)
Return an amx file as a String from the given path. Any include tags will be expanded and their referenced content inserted within the tag, and any referenced bindings will be brought into the parent binding container. Included bindings will have their identifiers prefixed with the include tag id

Parameters:
page - - the path to the page to load

setContext

public String[] setContext(String contextKey)
                    throws AdfException
Set the context

Throws:
AdfException

setContextInstance

public String[] setContextInstance(String contextKey,
                                   String instanceId,
                                   boolean resetState,
                                   boolean reSync)
                            throws AdfException
Set the context

Throws:
AdfException

addBeanDefinition

public void addBeanDefinition(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition def)
Add a bean definition to the current context.


removeBeanDefinition

public void removeBeanDefinition(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition def)
Remove a bean definition from the current context. Note this only removes the ability to instantiate the defined bean in the future - if a bean instance has been instantiated in a scope already, it will remain resolvable. If callers wish to clear the instance they will need to do so explicitly through a setValue call.


setBeanDefinitions

public void setBeanDefinitions(oracle.adfmf.framework.contract.adf.ManagedBeanDefinition[] defs)
                        throws AdfException
Set the bean definitions into the current context - Clears all currently registered definitions. Note that if a bean has been instantiated in a scope, clearing the definition will -not- destroy the bean instance.

Throws:
AdfException

loadBundle

public void loadBundle(String baseName,
                       String variable)
                throws AdfException
Load the given resource bundle

Parameters:
baseName - of the resource bundle
variable - of the resource bundle
Throws:
AdfException

loadBundle

public static void loadBundle(AdfELContext context,
                              String baseName,
                              String variable)
                       throws AdfException
Load the given resource bundle

Parameters:
context - EL context
baseName - of the resource bundle
variable - of the resource bundle
Throws:
AdfException

createRestServiceAdapter

public static RestServiceAdapter createRestServiceAdapter()
Get an empty REST service adapter object.


deviceIsReady

public static void deviceIsReady()
Signals device is ready


waitForDeviceReady

public static void waitForDeviceReady()
Wait for device is ready

Throws:
Exception - if timeout or interrupted

addMonitorObservations

public static void addMonitorObservations(oracle.adfmf.json.JSONArray array)

addMonitorObservation

public static void addMonitorObservation(String monitorId,
                                         double duration)

addMonitorObservation

public static void addMonitorObservation(String monitorId,
                                         String description,
                                         double duration)

Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

Copyright © 2014 Oracle. All Rights Reserved.