Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.uicli.jui
Class JUEnvInfoProvider

java.lang.Object
  extended byoracle.jbo.uicli.jui.JUEnvInfoProvider
All Implemented Interfaces:
EnvInfoProvider

public class JUEnvInfoProvider
extends java.lang.Object
implements EnvInfoProvider


Constructor Summary
JUEnvInfoProvider()
           
 
Method Summary
 java.lang.Object getInfo(java.lang.String info, java.lang.Object environment)
          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.
 void modifyInitialContext(java.lang.Object environment)
          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

JUEnvInfoProvider

public JUEnvInfoProvider()
Method Detail

getInfo

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

1. An ApplicationModule instance is created 2. An ApplicationModule instance is connected 3. 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 providing session context for the ApplicationModule instance in the environment Hashtable which is passed to getInfo.

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 {@link oracle.jbo.server.ApplicationModuleImpl#prepareSession(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, ); ((Hashtable)env).put(Configuration.DB_PASSWORD_PROPERTY, ); ((Hashtable)env).put(Configuration.DB_CONNECT_STRING_PROPERTY, ); 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 - Unused. Retained for legacy reasons. Please note that before connecting the pooling framework may invoke getInfo multiple times with the following values for the info parameter: 1. Configuration.DB_USERNAME_PROPERTY 2. Configuration.DB_PASSWORD_PROPERTY 3. null Though it is only necessary to actually respond to the null request.
environment - a Hashtable object containing the environment that will be passed to: oracle.jbo.Transaction.connect(String, Properties) oracle.jbo.server.ApplicationModuleImpl.prepareSession(Session)
Returns:
Unused. Retained for legacy reasons.
See Also:
for an example implementation of an EnvInfoProvider for a JClient.

modifyInitialContext

public void modifyInitialContext(java.lang.Object environment)
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 ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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