|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1) E10686-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.adf.share.ADFContext
public abstract class ADFContext
The execution context for an ADF application
Field Summary | |
---|---|
static java.lang.String |
ADF_PROPERTY_NS |
static java.lang.String |
ADF_SESSIONDEF_PACKAGES |
static java.lang.String |
APPLICATION_DATA_KEY |
static java.lang.String |
APPLICATION_DATA_SEP |
protected static java.lang.String |
APPLICATION_NAME_SCOPE_KEY |
static java.lang.String |
APPLICATION_SCOPE |
static java.lang.String |
APPLICATION_UID |
static java.lang.String |
ATTRIBUTE_FORMATTER_MAP_KEY |
static java.lang.String |
CONNECTIONS_RESOURCE |
static java.lang.String |
MDS_CC_VALUES_FOR_EDIT |
static java.lang.String |
MDS_PARTITION_APPID |
static java.lang.String |
MDS_SESSION_OPTIONS_FACTORY |
static java.lang.String |
NAMED_CONTEXT_ENV |
static java.lang.String |
PERSDEF_BASE_PACKAGE |
static java.lang.String |
REQUEST_SCOPE |
static java.lang.String |
SESSION_SCOPE |
static java.lang.String |
SESSIONDEF_BASE_PACKAGE |
static int |
TYPE_GENERIC |
static int |
TYPE_HTTP |
static int |
TYPE_NAMED |
static int |
TYPE_PORTLET |
static java.lang.String |
USE_ROLE_BASED_CUST_CLASS |
static java.lang.String |
USER_CUST_CLASSES |
static java.lang.String |
VIEW_SCOPE |
Constructor Summary | |
---|---|
protected |
ADFContext() |
Method Summary | |
---|---|
void |
clearCachedLocale() Clears the cached locale for the context and it's Enviroment (if any). |
java.util.Map |
createScope(java.lang.String name) May be implemented by custom ADFContext classes to create a scope for the specfied name. |
protected java.util.Map<java.lang.String,java.lang.Object> |
createScope(java.lang.String name, boolean concurrent) |
protected java.util.Map<java.lang.String,java.lang.Object> |
findApplicationScopeMap() |
java.util.Map<java.lang.String,java.lang.Object> |
findScope(java.lang.String name) Retrieve a scope from the ADFContext. |
static ADFContext |
get(java.lang.String name) This method will be used by callers that have already associated a named context using registerNamedContext method. |
java.lang.String |
getADFApplicationUID() This method will help to get application UID for the JPS unqiue map name to resolve BUG5985198 |
ADFConfig |
getADFConfig() Gets the ADF configuration Object used by current thread. |
ADFConfigEx |
getADFConfigEx() |
java.lang.String |
getADFContextProperty(java.lang.String propName) This method will help find all ADFContext nodes in adf-config.xml and return property value based on the name |
java.util.Map<java.lang.String,java.lang.Object> |
getADFFacesViewScopeMap() |
ADFSettings |
getADFSettings() Gets the ADF Settings Object used by current thread. |
ADFConfig |
getApplication() Deprecated. Use getADFConfig() instead. |
java.lang.String |
getApplicationName() Gets the Application Name. |
java.util.Map<java.lang.String,java.lang.Object> |
getApplicationScope() A convenience method for the standard applicationScope. |
protected java.lang.Object |
getApplicationScopekey() The application scope as defined by the ADFContext environment in which the application is being used. |
protected java.util.Map<java.lang.String,java.lang.Object> |
getApplicationScopeMap() |
javax.naming.Context |
getConfigSecurityContext() Gets the security context for the current thread |
javax.naming.Context |
getConnectionsContext() Convenience for accessing the adf jndi context, for managing adf connection definitions. |
abstract int |
getContextType() Returns a type for the context instance. |
static ADFContext |
getCurrent() Gets the ADF context for the current thread |
protected java.lang.String |
getDeployedAppName() This method should be overriden in sublclasses so that the appropriate application name is returned. |
java.lang.String |
getEnterpriseId() |
Environment |
getEnvironment() |
ADFExpressionEvaluator |
getExpressionEvaluator() |
java.util.Locale |
getLocale() |
protected ADFContextMDSConfigHelper |
getMDSConfigHelper() |
java.lang.Object |
getMDSInstanceAsObject() |
java.lang.String |
getMDSLogin() |
java.lang.Object |
getMDSSessionAsObject() Get the MDS session associated with this context. |
java.util.Map |
getRequestScope() A convenience method for the standard requestScope. |
java.util.Map<java.lang.String,java.lang.Object> |
getScope(java.lang.String name) Retrieve a scope from the ADFContext. |
java.util.Set |
getScopeNames() Returns the names of all the scopes that are supported by the current ADFContext. |
SecurityContext |
getSecurityContext() Gets the security context for the current thread |
java.util.List |
getSessionDefPackages() |
java.util.Map |
getSessionScope() A convenience method for the standard sessionScope. |
java.lang.Object |
getSkipLevelIdentifier() To be used by DataControls and Bindings to identify a particular slot as skipped in the keypath datastructure. |
java.util.Map |
getStateManager(java.lang.String scopeName, java.util.Hashtable env) Returns a StateManagerScopeAdapter for the specified scope. |
static java.lang.Object |
getThreadLocalValue(java.lang.Object key) |
java.net.URL |
getURL() This method can be overridden by subclasses that have a specific instance of adf-config.xml document associated with it. |
javax.servlet.jsp.el.VariableResolver |
getVariableResolver() Returns a variable resolver for this context. |
java.util.Map<java.lang.String,java.lang.Object> |
getViewScope() This method delegates the supporting technology such as Faces or Trinidad to provide the installed View Scope. |
static boolean |
hasCurrent() Check if the thread local already has ADFContext set. |
boolean |
hasEnvironment() |
boolean |
hasMDSSession() Determine if there is a MDS session associated with this context |
boolean |
hasSecurityContext() Determine if there is a SecurityContext associated with this context |
boolean |
hasSession() Checks the environment to see if this ADFContext references a native session. |
static ADFContext |
initADFContext(java.lang.Object context, java.lang.Object session, java.lang.Object request, java.lang.Object response) Initializes the ADFContext for the environment of the specified context. |
boolean |
isDesignTime() This method will try to determine if the operating environment is Design Time. |
boolean |
isHttpContext() Returns true if the ADFContext is running in an http container. |
boolean |
isJEE() Returns true if executed in a JEE Container. |
static boolean |
isNamedContextRegistered(java.lang.String name) This method can be used to check if a NamedContext already exists for the provided name. |
protected abstract Environment |
loadEnvironment() |
protected SecurityContext |
loadSecurityContext() |
protected void |
putApplicationScopeMap(java.util.Map<java.lang.String,java.lang.Object> scope) The application scope as defined by the ADFContext environment in which the application is being used. |
void |
putScope(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> scope) Add a scope to the ADFContext. |
static void |
registerNamedContext(java.lang.String name, java.net.URL url) |
static void |
registerNamedContext(java.lang.String name, java.net.URL url, java.lang.Class implClass) This method provides the ability to create a named ADFContext by specifying the url of the adf-config.xml file from which this ADFContext will provide the callers configuration information. |
void |
releaseMDSInstance() |
void |
releaseMDSSession() Provides api for releasing the MDS session |
void |
removeAsCurrent() Disassociates this context from the current thread. |
java.util.Map<java.lang.String,java.lang.Object> |
removeScope(java.lang.String name) Remove a scope from the ADFContext. |
static java.lang.Object |
removeThreadLocalValue(java.lang.Object key) |
static void |
resetADFContext(ADFContext ctx) Restore the ADFContext to the value before initADFContext was invoked. |
void |
setAsCurrent() Sets up this context as the current context. |
void |
setEnterpriseId(java.lang.String eid) |
void |
setExpressionEvaluator(ADFExpressionEvaluator expressionEvaluator) |
void |
setLocale(java.util.Locale locale) Set a locale for the context. |
void |
setMDSLogin(java.lang.String loginStr) |
void |
setSecurityContext(SecurityContext ctx) Internal: Applications should not use this method. |
static void |
setThreadLocalValue(java.lang.Object key, java.lang.Object value) |
void |
setVariableResolver(javax.servlet.jsp.el.VariableResolver variableResolver) |
static void |
unregisterNamedContext(java.lang.String name) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TYPE_GENERIC
public static final int TYPE_HTTP
public static final int TYPE_PORTLET
public static final int TYPE_NAMED
public static final java.lang.String MDS_PARTITION_APPID
public static final java.lang.String MDS_SESSION_OPTIONS_FACTORY
public static final java.lang.String SESSION_SCOPE
public static final java.lang.String REQUEST_SCOPE
public static final java.lang.String APPLICATION_SCOPE
public static final java.lang.String VIEW_SCOPE
public static final java.lang.String SESSIONDEF_BASE_PACKAGE
public static final java.lang.String PERSDEF_BASE_PACKAGE
public static final java.lang.String NAMED_CONTEXT_ENV
public static final java.lang.String USE_ROLE_BASED_CUST_CLASS
public static final java.lang.String USER_CUST_CLASSES
public static final java.lang.String ADF_SESSIONDEF_PACKAGES
public static final java.lang.String MDS_CC_VALUES_FOR_EDIT
public static final java.lang.String APPLICATION_DATA_KEY
public static final java.lang.String APPLICATION_DATA_SEP
protected static final java.lang.String APPLICATION_NAME_SCOPE_KEY
public static final java.lang.String CONNECTIONS_RESOURCE
public static final java.lang.String ADF_PROPERTY_NS
public static final java.lang.String APPLICATION_UID
public static final java.lang.String ATTRIBUTE_FORMATTER_MAP_KEY
Constructor Detail |
---|
protected ADFContext()
Method Detail |
---|
protected abstract Environment loadEnvironment()
public void putScope(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> scope)
Scopes may be used by ADF applications to store application state. For example, the following code could be used to store an application state in the sessionScope:
Map sessionScope = ADFContext.getCurrent().getSessionScope().put(<stateId>, <state>);
ADF supports three standard scopes: applicationScope, sessionScope, and requestScope. The lifecycles of these scopes are defined in the ADFScopes documentation and may depend upon the ADFContext's environment. For example, the lifecycle of the sessionScope may be different in a servlet container than it would be in an EJB container or in a java application.
This method may be used by applications that wish to define custom scopes. If an application has defined a custom scope then it is the application's responsibility to manage the lifecycle of that custom scope.
Please note that a custom scope's lifecycle cannot exceed that of the ADFContext itself -- once the ADFContext goes out of scope then all custom scopes will also go out of scope. Applications that require a custom scope with a lifecycle greater than the ADFContext's must manage those custom scopes elsewhere and associate them with each ADFContext object as it comes into scope.
For example, in a servlet container the ADFContext has request level scope -- once request processing ends the ADFContext object will go out of scope. However, the sessionScope must have a scope that spans multiple requests. ADF solves this issue by associating the session scope to the ADFContext each time the ADFContext is created.
name
- the name of the scope. Scope names should implement the pattern <scopeType>Scope. The session, request, and application scope types are reserved for use by ADF and should not be used by applications.scope
- the scope implementation. All scope implementations must implement the java.util.Map interface.public boolean isDesignTime()
public java.util.Map<java.lang.String,java.lang.Object> getScope(java.lang.String name)
See putScope(String,Map)
for more information about scopes.
name
- the scope name.public java.util.Map<java.lang.String,java.lang.Object> findScope(java.lang.String name)
name
- the scope name.protected java.lang.Object getApplicationScopekey()
protected void putApplicationScopeMap(java.util.Map<java.lang.String,java.lang.Object> scope)
scope
- - The application scope.protected java.util.Map<java.lang.String,java.lang.Object> getApplicationScopeMap()
protected java.util.Map<java.lang.String,java.lang.Object> findApplicationScopeMap()
public java.util.Map<java.lang.String,java.lang.Object> getViewScope()
public java.util.Map<java.lang.String,java.lang.Object> getADFFacesViewScopeMap()
public java.util.Map createScope(java.lang.String name)
getScope(String)
will invoke this method if the specified scope has not already been associated with the current ADFContext. The new scope will be associated with the context until removed or until the context is destroyed.
protected java.util.Map<java.lang.String,java.lang.Object> createScope(java.lang.String name, boolean concurrent)
public java.util.Map<java.lang.String,java.lang.Object> removeScope(java.lang.String name)
See putScope(String,Map)
for more information about scopes.
name
- the scope name.public java.util.Set getScopeNames()
See putScope(String,Map)
for more information about scopes. returns a set of scope names.
public java.util.Map<java.lang.String,java.lang.Object> getApplicationScope()
Equivalent to invoking getScope(APPLICATION_SCOPE).
public java.util.Map getSessionScope()
Equivalent to invoking getScope(SESSION_SCOPE).
public java.util.Map getRequestScope()
Equivalent to invoking getScope(REQUEST_SCOPE).
public ADFConfig getApplication()
public ADFConfig getADFConfig()
public java.lang.String getEnterpriseId()
public void setEnterpriseId(java.lang.String eid)
public ADFConfigEx getADFConfigEx()
public ADFSettings getADFSettings()
public SecurityContext getSecurityContext()
public boolean hasSecurityContext()
public javax.naming.Context getConnectionsContext() throws javax.naming.NamingException
javax.naming.NamingException
public static boolean hasCurrent()
public static ADFContext getCurrent()
public java.lang.String getADFContextProperty(java.lang.String propName)
propName
- the property name, like "adfAppUID"public java.lang.String getADFApplicationUID()
public static void registerNamedContext(java.lang.String name, java.net.URL url, java.lang.Class implClass) throws javax.naming.NameAlreadyBoundException
name
- - The name to be given to this Context.url
- - The string representing the URL to the adf-config.xml file to be associated with this named context.implClass
- - concrete class for the context implementationjavax.naming.NameAlreadyBoundException
- - thrown if a context with the contextInfos already existspublic static void registerNamedContext(java.lang.String name, java.net.URL url) throws javax.naming.NameAlreadyBoundException
javax.naming.NameAlreadyBoundException
public static void unregisterNamedContext(java.lang.String name)
name
- of the namedContext that is registered with ADFContext Unregister the Named Context if it is registered.public static boolean isNamedContextRegistered(java.lang.String name)
name
- of the registered contextpublic static ADFContext get(java.lang.String name) throws java.lang.Exception
name
- - The name of the context for which ADFContext is to be returnedjava.lang.Exception
- - If a contextInfos for this name was not already createdregisterNamedContext
public java.net.URL getURL()
public java.lang.String getApplicationName()
protected java.lang.String getDeployedAppName()
public void setAsCurrent()
public void removeAsCurrent()
public void setSecurityContext(SecurityContext ctx)
public java.lang.String getMDSLogin()
public void setMDSLogin(java.lang.String loginStr)
protected SecurityContext loadSecurityContext()
public javax.naming.Context getConfigSecurityContext() throws javax.naming.NamingException
javax.naming.NamingException
public java.util.Locale getLocale()
public void setLocale(java.util.Locale locale)
public void clearCachedLocale()
public final Environment getEnvironment()
public boolean hasEnvironment()
public javax.servlet.jsp.el.VariableResolver getVariableResolver()
The VariableResolver will be used whenever evaluating expressions that will be evaluated by the ADFContext expression evaluator.
public void setVariableResolver(javax.servlet.jsp.el.VariableResolver variableResolver)
public ADFExpressionEvaluator getExpressionEvaluator()
public void setExpressionEvaluator(ADFExpressionEvaluator expressionEvaluator)
public java.util.Map getStateManager(java.lang.String scopeName, java.util.Hashtable env)
public boolean isJEE()
public abstract int getContextType()
public boolean isHttpContext()
Applications may use this to determine if it is okay to reference Http classes.
public boolean hasSession()
public java.lang.Object getMDSInstanceAsObject()
public java.lang.Object getMDSSessionAsObject()
public java.util.List getSessionDefPackages()
public boolean hasMDSSession()
getMDSSessionAsObject
public void releaseMDSSession()
public void releaseMDSInstance()
public java.lang.Object getSkipLevelIdentifier()
protected ADFContextMDSConfigHelper getMDSConfigHelper()
public static java.lang.Object getThreadLocalValue(java.lang.Object key)
public static void setThreadLocalValue(java.lang.Object key, java.lang.Object value)
public static java.lang.Object removeThreadLocalValue(java.lang.Object key)
public static ADFContext initADFContext(java.lang.Object context, java.lang.Object session, java.lang.Object request, java.lang.Object response)
context
- the ServletContext or PortletContext of the current execution environment.session
- the HttpSession or PortletSession of the current execution environment. OPTIONAL.request
- the HttpServletRequest or PortletRequest of the current execution environment. OPTIONAL.response
- the HttpServletResponse or PortletResponse of the current execution environment. OPTIONAL.public static void resetADFContext(ADFContext ctx)
ctx
- the ADFContext that was returned from initADFContext.
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Share 11g Release 1 (11.1.1) E10686-03 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |