|
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.jbo.http.HttpContainer
A container for BC4J HTTP context resources. This class is intended for use by BC4J classes that must cache application resources in one of the servlet/jsp contexts. This may include the HttpSession, the HttpServletRequest, the HttpServletResponse, and the PageContext.
The container provides a listener interface to notify cached BC4J resources when they are bound and unbound from the context container.
Field Summary | |
static java.lang.String |
APPLICATION_BINDING_LISTENER_PREFIX
|
static java.lang.String |
APPLICATION_COOKIE_PREFIX
|
static java.lang.String |
APPLICATION_PREFIX
|
static java.lang.String |
PAGE_CONTEXT_CONTAINER_NAME
|
static java.lang.String |
SESSION_CONTEXT_CONTAINER_NAME
|
Constructor Summary | |
HttpContainer()
Should not be invoked directly. |
|
HttpContainer(java.lang.Object contextRef)
Deprecated. This class should not be instantiated directly. Use getInstanceFromSession(HttpSession) instead. |
Method Summary | |
void |
clear(java.util.Properties userProperties)
|
void |
cookieUpdated()
|
java.lang.String |
encodeURL(java.lang.String url)
Encode a URL with the values of the session cookies that are contained by this container. |
static SessionCookie |
findSessionCookie(javax.servlet.http.HttpSession session,
java.lang.String applicationId,
java.lang.String applicationDefinitionName,
java.util.Properties cookieProperties)
Locates a SessionCookie instance with the specified applicationId in the HttpContainer associated with this session. |
static SessionCookie |
findSessionCookie(javax.servlet.http.HttpSession session,
java.lang.String applicationId,
java.lang.String poolName,
java.lang.String configPackage,
java.lang.String configSection,
java.util.Properties poolProps,
java.util.Properties cookieProps)
Locates a SessionCookie instance with the specified applicationId in the HttpContainer associated with this session. |
static HttpContainer |
getInstanceFromSession(javax.servlet.http.HttpSession session)
Retrieve an http container instance from the http session context. |
SessionCookie |
getSessionCookie(java.lang.String applicationId)
Get a session cookie instance from the http session container. |
SessionCookie[] |
getSessionCookies()
Get all session cookie instances from the http session container. |
java.lang.Object |
getValue(java.lang.Object key)
|
java.lang.Object |
putValue(java.lang.Object key,
java.lang.Object value,
java.util.Properties userProperties)
|
java.lang.Object |
removeValue(java.lang.Object key,
java.util.Properties userProperties)
|
java.lang.Object |
removeValueInternal(java.lang.Object key)
|
void |
setSessionCookie(java.lang.String applicationId,
SessionCookie cookie)
Set a session cookie instance in the http session container. |
void |
timeout(java.util.Properties userProperties)
|
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent e)
|
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
|
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 PAGE_CONTEXT_CONTAINER_NAME
public static final java.lang.String SESSION_CONTEXT_CONTAINER_NAME
public static final java.lang.String APPLICATION_COOKIE_PREFIX
public static final java.lang.String APPLICATION_BINDING_LISTENER_PREFIX
public static final java.lang.String APPLICATION_PREFIX
Constructor Detail |
public HttpContainer(java.lang.Object contextRef)
getInstanceFromSession(HttpSession)
instead.
public HttpContainer()
getInstanceFromSession(HttpSession)
instead.
Public for backwards compatibility only.
Method Detail |
public java.lang.Object getValue(java.lang.Object key)
public java.lang.Object removeValue(java.lang.Object key, java.util.Properties userProperties)
public java.lang.Object removeValueInternal(java.lang.Object key)
public void clear(java.util.Properties userProperties)
public void timeout(java.util.Properties userProperties)
public java.lang.Object putValue(java.lang.Object key, java.lang.Object value, java.util.Properties userProperties)
public void valueBound(javax.servlet.http.HttpSessionBindingEvent e)
valueBound
in interface javax.servlet.http.HttpSessionBindingListener
public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent e)
valueUnbound
in interface javax.servlet.http.HttpSessionBindingListener
public static HttpContainer getInstanceFromSession(javax.servlet.http.HttpSession session)
session
- the target http session contextpublic SessionCookie getSessionCookie(java.lang.String applicationId)
applicationId
- the application id that will be used to reference the
session cookiepublic SessionCookie[] getSessionCookies()
public void setSessionCookie(java.lang.String applicationId, SessionCookie cookie)
applicationId
- the application id that will be used to reference the
session cookiecookie
- the session cookie instance that will be storedpublic java.lang.String encodeURL(java.lang.String url)
SessionCookie.readValue(Object)
when and if the session cookie is re-instantiated.
public void cookieUpdated()
cookieUpdated
in interface SessionCookieListener
public static SessionCookie findSessionCookie(javax.servlet.http.HttpSession session, java.lang.String applicationId, java.lang.String applicationDefinitionName, java.util.Properties cookieProperties)
This method will use an application defintion (defined in a .cpx file) to create/locate an ApplicationPool. That ApplicationPool will be used to generate the requested SessionCookie.
The optional cookie properties parameter may be used to pass
properties through to the SessionCookieFactory
instance which will create the SessionCookie. For example, the
HttpSessionCookieFactory
may be passed
the current HttpServletRequest in the properties object with the
oracle.jbo.http.HttpSessionCookieFactory.HTTP_SERVLET_REQUEST
key. The request will be used to acquire a sessionId from the
HttpSession and to determine if a BC4J application cookie, representing
a failed over ApplicationModule state, was written in a previous request.
This method will register an HttpSessionCookieFactory with the target pool unless a custom SessionCookieFactory has been specified.
Please see the javadoc for the SessionCookieFactory implementation which has been specified for more information about supported properties.
session
- - the session in which the cookie will be cachedapplicationId
- - the cookie cache key. The application id will
also be used as part of the cookie identity if a cookie must be
created.applicationDefinitionName
- - a named ApplicationDefinition. The
applicationDefintionName will be used to locate/create an
ApplicationPool.cookieProperties
- - a collection of Properties to be used during
cookie creation (see SessionCookieFactory.createSessionCookie(String, String, ApplicationPool, Properties)
).SessionCookie
,
ApplicationPool
,
JUMetaObjectManager
,
HttpSessionCookieFactory
,
SharedSessionCookieFactory
,
public static SessionCookie findSessionCookie(javax.servlet.http.HttpSession session, java.lang.String applicationId, java.lang.String poolName, java.lang.String configPackage, java.lang.String configSection, java.util.Properties poolProps, java.util.Properties cookieProps)
This method will use the pool name and a named configuration (defined in a .xcfg file) to create/locate an ApplicationPool. That ApplicationPool will be used to generate the requested SessionCookie if a cookie is not located.
The optional pool properties parameter may be used to configure the pool at runtime. If a pool must be created then the pool properties will be merged with the specified configuration (please note that the properties will not be used if the pool already exists). In the case of property conflicts between the runtime specified properties and the Configuration properties, the runtime properties will take precendence. The merged Configuration and pool properties will be copied into the ApplicationPool environment and eventually into the SessionCookie environment. Examples of valid pool properties include:
PropertyConstants.ENV_DO_FAILOVER PropertyConstants.ENV_DO_CONNECTION_POOLING PropertyConstants.ENV_AMPOOL_DYNAMIC_JDBC_CREDENTIALS PropertyConstants.ENV_AMPOOL_RESET_NON_TRANSACTIONAL_STATE PropertyConstants.ENV_AMPOOL_MAX_POOL_SIZE PropertyConstants.ENV_AMPOOL_INIT_POOL_SIZE PropertyConstants.ENV_AMPOOL_MONITOR_SLEEP_INTERVAL PropertyConstants.ENV_AMPOOL_MIN_AVAIL_SIZE PropertyConstants.ENV_AMPOOL_MAX_AVAIL_SIZE PropertyConstants.ENV_AMPOOL_MAX_INACTIVE_AGE
Please see the BC4J documentation for a description of each of these properties.
The optional cookie properties parameter may be used to pass
properties through to the tory
instance which will create the SessionCookie. For example, the
HttpSessionCookieFactory
may be passed
the current HttpServletRequest in the properties object with the
oracle.jbo.http.HttpSessionCookieFactory.HTTP_SERVLET_REQUEST
key. The request will be used to acquire a sessionId from the
HttpSession and to determine if a BC4J application cookie, representing
a failed over ApplicationModule state, was written in a previous request.
This method will register an HttpSessionCookieFactory with the target pool unless a custom SessionCookieFactory has been specified.
Please see the javadoc for the SessionCookieFactory implementation which has been specified for more information about supported properties.
session
- - the session in which the cookie will be cachedapplicationId
- - the cookie cache key. The application id will
also be used as part of the cookie identity if a cookie must be
created.poolName
- - the pool key of the ApplicationPool which will be used
to generate the SessionCookie (see Mgr#findPool(String, String, String, Properties)
).
configPackage
- - the configuration package. For instance, if the
configuration is defined for an ApplicationModule with the full name,
"hrpackage.HRAppModule", then the configPackage name is
"hrpackage".
configSection
- - the configuration name. In the example for
the configuration package above the configuration name might be
"HRAppModuleLocal".
poolProps
- - a collection of properties to be used during pool
creation.
cookieProps
- - a collection of Properties to be used during
cookie creation (see ry#createSessionCookie(String, String, ApplicationPool, Properties)
).SessionCookie
,
ApplicationPool
,
JUMetaObjectManager
,
HttpSessionCookieFactory
,
SharedSessionCookieFactory
,
|
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.