|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.html.WebBeanImpl oracle.jbo.html.jsp.JSPApplicationRegistry
This class provides the main interface for DataWebBeans to use the Application Module Pool. View implementation of JSPApplicationRegistry
Field Summary | |
static java.lang.String |
RESERVED
|
static java.lang.String |
STATEFUL
|
static java.lang.String |
STATELESS
|
Fields inherited from class oracle.jdeveloper.html.WebBeanImpl |
application, bUsedInTag, out, page, request, response, session |
Fields inherited from interface oracle.jdeveloper.html.WebBean |
contentFrameName, defaultCaboBase, defaultCaboImageBase, defaultImageBase, defaultJSPBase, defaultNLSFormat, JS_LIBRARIES, JS_NAMEID, JSButtonConstructorLib, JSCalendarConstructorLib, JSContainerConstructorLib, JSDataConstructLib, JSModalPageConstructorLib, JSTableConstructLib, JSToolbarConstructorLib, JSTreeConstructLib, JSUtilitiesLib |
Constructor Summary | |
JSPApplicationRegistry()
Constructor, this should not be called directly |
Method Summary | |
ApplicationModule |
getAppModuleFromContexts(java.lang.String applicationId,
javax.servlet.http.HttpSession session,
javax.servlet.jsp.PageContext pageContext)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleFromContexts (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information): HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule(); where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance). |
ApplicationModule |
getAppModuleFromSession(java.lang.String applicationId,
javax.servlet.http.HttpSession session)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleFromContexts (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information): HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule(); where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance). |
ApplicationModule |
getAppModuleFromSession(java.lang.String applicationId,
java.lang.String poolName,
javax.servlet.http.HttpSession session)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleFromContexts (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information): HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule(); where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance). |
ApplicationModule |
getAppModuleInstance(java.lang.String applicationId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
javax.servlet.http.HttpSession session)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleInstance: // Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule(); where configPackage is the fully qualified package name of the ApplicationModule. For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling". |
ApplicationModule |
getAppModuleInstance(java.lang.String applicationId,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpSession session)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleInstance: // Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule(); where configPackage is the fully qualified package name of the ApplicationModule. For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling". |
ApplicationModule |
getAppModuleInstance(java.lang.String applicationId,
javax.servlet.jsp.PageContext pageContext)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleInstance: // Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule(); where configPackage is the fully qualified package name of the ApplicationModule. For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling". |
ApplicationModule |
getAppModuleInstance(java.lang.String applicationId,
java.lang.String poolName,
javax.servlet.jsp.PageContext pageContext)
Deprecated. application developers should use the following sample to acquire an ApplicationModule instead of getAppModuleInstance: // Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule(); where configPackage is the fully qualified package name of the ApplicationModule. For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling". |
static java.util.Hashtable |
getAppSettings(java.lang.String poolName)
Returns the user data associated with the named pool. |
static HttpContainer |
getHttpContainer(javax.servlet.http.HttpSession session)
Deprecated. use HttpContainer.getInstanceFromSession(session) instead |
static JSPApplicationRegistry |
getInstance()
Returns the singleton instance of the registry class. |
java.lang.String |
getReleaseMode(java.lang.String applicationId)
Helper method to obtain the specified application's release mode. |
protected java.lang.String |
readSessionId(javax.servlet.http.HttpServletRequest request,
java.lang.String applicationId)
Deprecated. the sessionId is now managed by the SessionCookie. Application developers wishing to override sessionId generation should create a custom SessionCookieFactory. Application developers wishing to override how snapshot id(s) are stored and/or loaded should override: {@link oracle.jbo.http.HttpSessionCookieImpl#writeValue(Object sink) {@link oracle.jbo.http.HttpSessionCookieImpl#readValue(Object source) |
static void |
registerApplicationFromPropertyFile(javax.servlet.http.HttpSession session,
java.lang.String sPropFileName)
Convenience method for defining a new application pool from a property file. |
static void |
registerApplicationFromPropertyFile(java.lang.String sPropFileName)
Creates a new application pool from the contents of a property file. |
void |
releaseAppModuleInstance(ApplicationModule appModule,
ApplicationPool pool,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletResponse response,
java.lang.String releaseMode)
Deprecated. application developers should use the following sample to release an ApplicationModule instead of releaseAppModuleInstance (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information):
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if ( |
void |
releaseAppModuleInstance(ApplicationModule appModule,
ApplicationPool pool,
javax.servlet.jsp.PageContext pageContext,
java.lang.String releaseMode)
Deprecated. application developers should use the following sample to release an ApplicationModule instead of releaseAppModuleInstance (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information):
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if ( |
void |
releaseAppModuleInstance(java.lang.String applicationId,
ApplicationModule appModule,
ApplicationPool pool,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletResponse response,
java.lang.String releaseMode)
Deprecated. application developers should use the following sample to release an ApplicationModule instead of releaseAppModuleInstance (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information):
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if ( |
void |
releaseAppModuleInstance(java.lang.String applicationId,
javax.servlet.http.HttpSession session,
javax.servlet.http.HttpServletResponse response,
java.lang.String releaseMode)
Deprecated. application developers should use the following sample to release an ApplicationModule instead of releaseAppModuleInstance (assumes that the ApplicationModule instance was acquired with a SessionCookie, see getAppModuleInstance for more information):
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if ( |
protected void |
writeSessionId(javax.servlet.http.HttpServletResponse response,
java.lang.String applicationId,
java.lang.String sessionId)
Deprecated. the sessionId is now managed by the SessionCookie. Application developers wishing to override sessionId generation should create a custom SessionCookieFactory. Application developers wishing to override how snapshot id(s) are stored and/or loaded should override: {@link oracle.jbo.http.HttpSessionCookieImpl#writeValue(Object sink) {@link oracle.jbo.http.HttpSessionCookieImpl#readValue(Object source) |
Methods inherited from class oracle.jdeveloper.html.WebBeanImpl |
generateScriptSrc, getCookie, getOut, getRequest, getRequestVariable, getRequestVariable, getUniqueName, initBeanForJS, initBeanForJS, initBeanForJS, initialize, initialize, initialize, internalInitialize, render, render, setRequestVariable, setRequestVariable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String RESERVED
public static final java.lang.String STATEFUL
public static final java.lang.String STATELESS
Constructor Detail |
public JSPApplicationRegistry()
Method Detail |
public static JSPApplicationRegistry getInstance()
public static java.util.Hashtable getAppSettings(java.lang.String poolName)
public void releaseAppModuleInstance(java.lang.String applicationId, ApplicationModule appModule, ApplicationPool pool, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, java.lang.String releaseMode)
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if (
The specified release mode will determine how the application module is returned to the pool. The following release modes are currently supported:
RESERVED: Do not allow the application module instance to be shared with other client requests. The reserved lock will be released when the application module is checked in by a latter request in the application life cycle or when the http session times out.
STATEFUL: Only available if a HttpServletResponse has been specified. The implementation will check the application module instance into the pool in a stateful manner which will allow the pool to maintain the application module state between session requests. This may involve passivating the session's application module state so that the application may be reused by other session requests. Using this option will cause a servlet cookie to be generated and written to the HttpServletResponse.
STATELESS: Check the application module instance into the pool without retaining application module state.
ApplicationPool
,
HttpContainer
,
HttpSessionCookie
public void releaseAppModuleInstance(java.lang.String applicationId, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, java.lang.String releaseMode)
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if (
HttpContainer
,
HttpSessionCookie
public void releaseAppModuleInstance(ApplicationModule appModule, ApplicationPool pool, javax.servlet.http.HttpSession session, javax.servlet.http.HttpServletResponse response, java.lang.String releaseMode)
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if (
void releaseAppModuleInstance(String, ApplicationModule, ApplicationPool, HttpSession, HttpServletResponse, String releaseMode)
,
HttpContainer
,
HttpSessionCookie
public void releaseAppModuleInstance(ApplicationModule appModule, ApplicationPool pool, javax.servlet.jsp.PageContext pageContext, java.lang.String releaseMode)
HttpContainer container = HttpContainer.getInstanceFromSession(session);
SessionCookie cookie = container.getSessionCookies(applicationId);
// only release the ApplicationModule if it was reserved
if (cookie != null && cookie.isApplicationModuleReserved())
{
if (
void releaseAppModuleInstance(String, ApplicationModule, ApplicationPool, HttpSession, HttpServletResponse, String releaseMode)
,
HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleInstance(java.lang.String applicationId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpSession session)
// Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule();
where configPackage is the fully qualified package name of the ApplicationModule.
For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling".
The implementation will attempt to locate an application module in the session context before asking the application pool for an application module.
If an application module is not found in the session or page contexts the implementation will check the http request for a session cookie value. If a session cookie value exists the method will instantiate a new (@link oracle.jbo.common.ampool.SessionCookie SessionCookie} instance using that cookie value. If a session cookie value is not found in the request then the method will invoke (@link #getSessionId getSessionId}. to obtain a unique session identifier. The returned session id will be used to instantiate a new (@link oracle.jbo.common.ampool.SessionCookie SessionCookie} instance.
The SessionCookie instance generated above is passed to the application pool during checkout. The application pool will use the session cookie to identify the client session and to activate any application state which may have been passivated at the end of a previous request from this session.
applicationId
- the id of the requesting session application
The applicationId should match the name of the pool that was used to
generate the requested instanceDataWebBeanImpl.internalInitialize()
,
HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleInstance(java.lang.String applicationId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.http.HttpSession session)
// Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule();
where configPackage is the fully qualified package name of the ApplicationModule.
For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling".
HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleInstance(java.lang.String applicationId, javax.servlet.jsp.PageContext pageContext)
// Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule();
where configPackage is the fully qualified package name of the ApplicationModule.
For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling".
getAppModuleInstance(String, HttpServletRequest, HttpSession)
,
HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleInstance(java.lang.String applicationId, java.lang.String poolName, javax.servlet.jsp.PageContext pageContext)
// Load the pool creation properties with the name of our custom // application pool class. Properties cookieProps = new Properties(); cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request); // Find a session cookie in the HttpSession for the specified // application id. If one does not exist this method will create one. SessionCookie cookie = HttpContainer.findSessionCookie( session , applicationId , configName // poolName , configPackage , configName , null // pool properties , cookieProps); ApplicationModule appModule = cookie.useApplicationModule();
where configPackage is the fully qualified package name of the ApplicationModule.
For more information please see the pooling sample at "$JDEV_HOME/BC4J/samples/Pooling".
getAppModuleInstance(String, HttpServletRequest, HttpSession)
,
HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleFromContexts(java.lang.String applicationId, javax.servlet.http.HttpSession session, javax.servlet.jsp.PageContext pageContext)
HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule();
where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance).
If the page context is not null then first check the page context for a Bc4jPageContext container. If one is found then check for the specified application module instance. Otherwise check if the specified application module instance has been placed in the session context.
applicationId
- the application module id of the requested
application module
The applicationId should match the name of the pool that was used to
generate the requested instancesession
- the HttpSession context that should be checked for the
named application module instancepageContext
- if a JSP client the name of the pageContext that
should be checked for the named application module instance. Null
otherwise.HttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleFromSession(java.lang.String applicationId, javax.servlet.http.HttpSession session)
HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule();
where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance).
applicationId
- the id of the requested application module instance
The applicationId should match the name of the pool that was used to generate
the requested instancesession
- the HttpSession context that should be checked for the
named application module instanceHttpContainer
,
HttpSessionCookie
public ApplicationModule getAppModuleFromSession(java.lang.String applicationId, java.lang.String poolName, javax.servlet.http.HttpSession session)
HttpContainer container = HttpContainer.getInstanceFromSession(session); SessionCookie cookie = container.getSessionCookies(applicationId); ApplicationModule am = cookie.useApplicationModule();
where the applicationId is the id that was used when the SessionCookie was created (see getAppModuleInstance).
applicationId
- the id of the requested application module instancepoolName
- the application name of the requesting threadsession
- the HttpSession context that should be checked for the
named application module instanceHttpContainer
,
HttpSessionCookie
public static void registerApplicationFromPropertyFile(javax.servlet.http.HttpSession session, java.lang.String sPropFileName)
public static void registerApplicationFromPropertyFile(java.lang.String sPropFileName)
public java.lang.String getReleaseMode(java.lang.String applicationId)
protected java.lang.String readSessionId(javax.servlet.http.HttpServletRequest request, java.lang.String applicationId)
Application developers wishing to override how snapshot id(s) are stored and/or loaded should override:
{@link oracle.jbo.http.HttpSessionCookieImpl#writeValue(Object sink) {@link oracle.jbo.http.HttpSessionCookieImpl#readValue(Object source)
HttpSessionCookieHelper.readCookieValue(HttpServletRequest, String)
protected void writeSessionId(javax.servlet.http.HttpServletResponse response, java.lang.String applicationId, java.lang.String sessionId)
Application developers wishing to override how snapshot id(s) are stored and/or loaded should override:
{@link oracle.jbo.http.HttpSessionCookieImpl#writeValue(Object sink) {@link oracle.jbo.http.HttpSessionCookieImpl#readValue(Object source)
HttpSessionCookieHelper.writeCookieValue(HttpServletResponse, String, String)
public static HttpContainer getHttpContainer(javax.servlet.http.HttpSession session)
HttpContainer
,
HttpSessionCookie
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.