|
Oracle Application Development Framework Lifecycle Java API Reference 10g Release 3 (10.1.3) B25779-01 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
oracle.adf.share.ADFContext
The execution context for an ADF application
| Field Summary | |
static java.lang.String |
APPLICATION_SCOPE |
static java.lang.String |
REQUEST_SCOPE |
static java.lang.String |
SESSION_SCOPE |
| Constructor Summary | |
ADFContext() |
|
| Method Summary | |
protected java.lang.Object |
createMDSSession() |
java.util.Map |
createScope(java.lang.String name)May be implemented by custom ADFContext classes to create a scope for the specfied name. |
ADFConfig |
getADFConfig()Gets the ADF configuration Object used by current thread. |
ADFConfig |
getApplication()Deprecated. Using getADFConfig() instead. |
java.util.Map |
getApplicationScope()A convenience method for the standard applicationScope. |
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. |
static ADFContext |
getCurrent()Gets the ADF context for the current thread |
Environment |
getEnvironment() |
oracle.adf.share.el.ADFExpressionEvaluator |
getExpressionEvaluator() |
java.lang.Object |
getMDSInstanceAsObject() |
java.lang.Object |
getMDSSessionAsObject() |
java.util.Map |
getRequestScope()A convenience method for the standard requestScope. |
java.util.Map |
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. |
oracle.adf.share.security.SecurityContext |
getSecurityContext()Gets the security context for the current thread |
java.util.Map |
getSessionScope()A convenience method for the standard sessionScope. |
java.util.Map |
getStateManager(java.lang.String scopeName, java.util.Hashtable env)Returns a StateManagerScopeAdapter for the specified scope. |
javax.servlet.jsp.el.VariableResolver |
getVariableResolver()Returns a variable resolver for this context. |
boolean |
hasEnvironment() |
boolean |
hasSession()Checks the environment to see if this ADFContext references a native session. |
boolean |
isHttpContext()Returns true if the ADFContext is running in an http container. |
protected abstract Environment |
loadEnvironment()Uncomment if classloader is not thread safe. |
protected oracle.adf.share.security.SecurityContext |
loadSecurityContext() |
void |
putScope(java.lang.String name, java.util.Map scope)Add a scope to the ADFContext. |
void |
removeAsCurrent()Disassociates this context from the current thread. |
java.util.Map |
removeScope(java.lang.String name)Remove a scope from the ADFContext. |
void |
setAsCurrent()Sets up this context as the current context. |
void |
setExpressionEvaluator(oracle.adf.share.el.ADFExpressionEvaluator expressionEvaluator) |
protected void |
setSecurityContext(oracle.adf.share.security.SecurityContext ctx) |
void |
setVariableResolver(javax.servlet.jsp.el.VariableResolver variableResolver) |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static java.lang.String SESSION_SCOPE
public static java.lang.String REQUEST_SCOPE
public static java.lang.String APPLICATION_SCOPE
| Constructor Detail |
public ADFContext()
| Method Detail |
protected abstract Environment loadEnvironment()
public void putScope(java.lang.String name,
java.util.Map 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 java.util.Map getScope(java.lang.String name)
See putScope(String,Map) for more information about scopes.
name - the scope name.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.
public java.util.Map 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 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 oracle.adf.share.security.SecurityContext getSecurityContext()
public javax.naming.Context getConnectionsContext()
throws javax.naming.NamingException
javax.naming.NamingExceptionpublic static ADFContext getCurrent()
public void setAsCurrent()
public void removeAsCurrent()
protected void setSecurityContext(oracle.adf.share.security.SecurityContext ctx)
protected oracle.adf.share.security.SecurityContext loadSecurityContext()
public javax.naming.Context getConfigSecurityContext()
throws javax.naming.NamingException
javax.naming.NamingExceptionpublic 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 oracle.adf.share.el.ADFExpressionEvaluator getExpressionEvaluator()
public void setExpressionEvaluator(oracle.adf.share.el.ADFExpressionEvaluator expressionEvaluator)
public java.util.Map getStateManager(java.lang.String scopeName,
java.util.Hashtable env)
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()
protected java.lang.Object createMDSSession()
|
Oracle Application Development Framework Lifecycle Java API Reference 10g Release 3 (10.1.3) B25779-01 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||