Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

oracle.jbo.common.ampool
Class OCIEnvInfoProvider

java.lang.Object
  extended by oracle.jbo.common.ampool.OCIEnvInfoProvider
All Implemented Interfaces:
EnvInfoProvider

public class OCIEnvInfoProvider
extends java.lang.Object
implements EnvInfoProvider

May be used to specify OCI proxy authentication properties to an <@link oracle.jbo.server.OCIConnectionPoolManagerImpl} instance.

See Also:
oracle.jbo.http.OCISessionCookieFactory

Field Summary
 
Fields inherited from interface oracle.jbo.common.ampool.EnvInfoProvider
INFO_TYPE_CONFIGURATION, INFO_TYPE_JDBC_PROPERTIES, INFO_TYPE_SESSION_ENVIRONMENT
 
Constructor Summary
OCIEnvInfoProvider(java.lang.String ociUserName, java.lang.String ociPassword, java.lang.String proxyUserName, java.lang.String proxyPassword)
           
 
Method Summary
 java.lang.Object getInfo(java.lang.String info, java.lang.Object connEnvironment)
          Invoked by the ApplicationPool to acquire dynamic application context before the following ApplicationModule lifecycle events:
 int getNumOfRetries()
          Returns the number times that the default connection strategy should attempt to create/connect and application module instance before failing.
protected  void initializeProxyUserProperties(java.util.Properties props)
           
 void modifyInitialContext(java.lang.Object p0)
          Invoked when the application pool is creating a new application module instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCIEnvInfoProvider

public OCIEnvInfoProvider(java.lang.String ociUserName,
                          java.lang.String ociPassword,
                          java.lang.String proxyUserName,
                          java.lang.String proxyPassword)
Method Detail

getInfo

public java.lang.Object getInfo(java.lang.String info,
                                java.lang.Object connEnvironment)
Description copied from interface: EnvInfoProvider
Invoked by the ApplicationPool to acquire dynamic application context before the following ApplicationModule lifecycle events:

1. A Configuration is loaded 2. An ApplicationModule instance is created 3. An ApplicationModule instance is connected 4. An ApplicationModule instance is reused by an ApplicationPool session which is differnt than the session which had previously used it. Please see SessionCookie for more information about ApplicationPool sessions.

An EnvInfoProvider implementation may respond to the request by modifying the passed environment. This gives the EnvInfoProvider implementation an opportunity to dynamically define Configuration properties, ApplicationModule envirionment properties, or JDBC properties.

getInfo is always invoked with a Hashtable instance though it may also be invoked with a java.util.Properties (extends Hashtable) in some scenarios. Any session context that is specified by getInfo will also be available in the BC4J middle tier via Session and during invocation of ApplicationModuleImpl.prepareSession(oracle.jbo.Session).

getInfo may also be used to dynamically specify JDBC credentials. For example, the following code snippet may be used to dynamically specify the JDBC credentials for the current ApplicationModule session (please see the article at http://otn.oracle.com/products/jdev/howtos/bc4j/howto_dynamic_jdbc.html for more information about dynamically specifying JDBC credentials to BC4J): ((Hashtable)env).put(Configuration.DB_USERNAME_PROPERTY, <username>); ((Hashtable)env).put(Configuration.DB_PASSWORD_PROPERTY, <password>); ((Hashtable)env).put(Configuration.DB_CONNECT_STRING_PROPERTY, <connect string>); return null;

Finally, getInfo may also be invoked multiple times during a connect attempt, if previous connect attempts have failed. This is intended to give the EnvInfoProvider an opportunity to correct the dynamic JDBC credentials before ultimately failing with an exception. The connection exception, if one occurred, is available to the EnvInfoProvider via the context with the DefaultConnectionStrategy.LAST_EXCEPTION key.

Specified by:
getInfo in interface EnvInfoProvider
Parameters:
info - Indicates the type of info that is being requested. Please note that before connecting the pooling framework may invoke getInfo multiple times with the following values for the info parameter: 1. INFO_TYPE_SESSION_ENVIRONMENT 2. INFO_TYPE_JDBC_PROPERTIES 3. INFO_TYPE_CONFIGURATION 4. Configuration.DB_USERNAME_PROPERTY 5. Configuration.DB_PASSWORD_PROPERTY The last two are not realy info types (they are JDBC properties) but are maintained for legacy reasons.
connEnvironment - a Hashtable object containing the environment that will be passed to: Transaction.connect(String, Properties) ApplicationModuleImpl.prepareSession(oracle.jbo.Session)
Returns:
Unused. Retained for legacy reasons.
See Also:
for an example implementation of an EnvInfoProvider for a JClient.

initializeProxyUserProperties

protected void initializeProxyUserProperties(java.util.Properties props)

modifyInitialContext

public void modifyInitialContext(java.lang.Object p0)
Description copied from interface: EnvInfoProvider
Invoked when the application pool is creating a new application module instance. The environment hashtable may be modified by the EnvInfoProvider to provide dynamic application module context.

Specified by:
modifyInitialContext in interface EnvInfoProvider

getNumOfRetries

public int getNumOfRetries()
Description copied from interface: EnvInfoProvider
Returns the number times that the default connection strategy should attempt to create/connect and application module instance before failing.

Specified by:
getNumOfRetries in interface EnvInfoProvider

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 1 (11.1.1.4.0)

E10653-05

Copyright © 1997, 2011, Oracle. All rights reserved.