oracle.clex.persistence.jndi
Class JndiObjectProvider

java.lang.Object
  |
  +--oracle.cle.persistence.ConnectionProvider
        |
        +--oracle.clex.persistence.jndi.JndiObjectProvider
All Implemented Interfaces:
Connectable, java.io.Serializable
Direct Known Subclasses:
DataSourceProvider, EJBHomeProvider

public abstract class JndiObjectProvider
extends ConnectionProvider

Provides a specific JndiObject.

Attributes can automatically be set and loaded by specifying properties in the "cle-providers.xml" file at the root of the classpath (ie. WEB-INF/classes/cle-providers.xml). See the http://xmlns.oracle.com/ias/mvc/cle-providers.dtd for more on structure of the file.

Unique requisite property not in parent classes:

Typical Usage in a Handler:

  public Vector aHandlerMethod(Object sessionId, <ArgumentType> aArgument)
    throws Exception
  {
    <JNDIObjectClass> jndiObject = (<JNDIObjectClass>)getConnection(sessionId);
    .... use the jndiObject here ...
    releaseConnection(jndiObject);

    return theResult;
  } // end aHandlerMethod
 

NOTE: This provider does not yet support caching for multiple principles or sessions. If this is a requirement, please provide the lookup code directly in your jndi client. Principle passing to through the ConnectionManager hierarchy is upcoming.

See Also:
Serialized Form

Field Summary
protected  java.lang.String jndiName
          This should be specified in the properties for this provider
static java.lang.String JNDINAME
          Constant for jndiname
protected  java.lang.Object jndiObject
          The JNDI Object that is provided by this class
protected  java.lang.String NON_SSL_LOGIN
           
 
Fields inherited from class oracle.cle.persistence.ConnectionProvider
BASE64, connection, connectionString, CONNECTIONSTRING, defaultProperties, deploymentKey, driverType, DRIVERTYPE, encryptionType, ENCRYPTIONTYPE, failover, FAILOVER, host, HOST, NO_SCOPE, NONE, password, PASSWORD, persistenceBase, PERSISTENCEBASE, port, PORT, releasedConnectionIds, REQUEST_SCOPE, scope, SCOPE, SESSION_SCOPE, sessionConnectionIds, sid, SID, USER, userName
 
Constructor Summary
JndiObjectProvider()
           
JndiObjectProvider(java.util.Properties properties)
           
 
Method Summary
protected  void addPropertyKeys()
          Each subclass should overload or override this method to include all the properties that it will use.
 void applyDynamicProperties(java.util.Properties dynamicProperties)
          applies dynamically in properties.
 void connect()
          Finds and sets the JNDI Object using its own provider info
 void disconnect()
          Set the current JNDI object to null
protected  java.lang.Object findJndiObject()
          Get a generic Jndi object.
 java.lang.Object getConnection(java.lang.Object sessionId)
          Returns a connection in form of a JNDI Object
 java.lang.Object getConnection(java.lang.Object sessionId, int failover)
          Does nothing...
protected abstract  javax.naming.Context getInitialContext()
           
protected  java.lang.String getJndiName()
           
 int hashCode()
          Override Object.hashCode() so that we can differentiate copies of this provider.
 boolean isSame(ConnectionProvider provider)
          Compares this ConnectionProvider with the specified one and returns true if their values are the same...
protected  void setJndiName(java.lang.String aString)
           
 
Methods inherited from class oracle.cle.persistence.ConnectionProvider
addPropertyKey, clone, compareDynamicProperties, compareProperty, equals, getConnection, getConnection, getConnection, getConnection, getConnection, getConnection, getConnectionString, getDefaultProperties, getDeploymentKey, getDriverType, getEncryptionType, getFailOver, getHost, getPassword, getPassword, getPersistenceBase, getPort, getProperty, getPropertyKeys, getScope, getSid, getUnspecifiedKeys, getUserName, issueWarnings, releaseAllConnections, releaseAllConnections, releaseConnection, releaseConnection, releaseConnection, releaseConnection, releaseRequestScopedConnections, releaseRequestScopedConnections, removePropertyKey, setConnectionString, setDefaultProperties, setDeploymentKey, setEncryptionType, setHost, setPassword, setPersistenceBase, setPort, setScope, setSid, setUserName, warn
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.cle.persistence.Connectable
isConnected
 

Field Detail

jndiObject

protected java.lang.Object jndiObject
The JNDI Object that is provided by this class

jndiName

protected java.lang.String jndiName
This should be specified in the properties for this provider

JNDINAME

public static final java.lang.String JNDINAME
Constant for jndiname

NON_SSL_LOGIN

protected java.lang.String NON_SSL_LOGIN
Constructor Detail

JndiObjectProvider

public JndiObjectProvider()

JndiObjectProvider

public JndiObjectProvider(java.util.Properties properties)
Method Detail

addPropertyKeys

protected void addPropertyKeys()
Each subclass should overload or override this method to include all the properties that it will use.
Overrides:
addPropertyKeys in class ConnectionProvider

hashCode

public int hashCode()
Override Object.hashCode() so that we can differentiate copies of this provider. Uses the String class' hashCode method because the mere mortals who wrote this method didn't want to be bothered by writing it
Overrides:
hashCode in class ConnectionProvider
See Also:
Object

isSame

public boolean isSame(ConnectionProvider provider)
Compares this ConnectionProvider with the specified one and returns true if their values are the same... false otherwise.
Overrides:
isSame in class ConnectionProvider

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId)
Returns a connection in form of a JNDI Object
Overrides:
getConnection in class ConnectionProvider

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId,
                                      int failover)
Does nothing... returns null
Overrides:
getConnection in class ConnectionProvider

connect

public void connect()
Finds and sets the JNDI Object using its own provider info

disconnect

public void disconnect()
Set the current JNDI object to null

setJndiName

protected void setJndiName(java.lang.String aString)

getJndiName

protected java.lang.String getJndiName()

getInitialContext

protected abstract javax.naming.Context getInitialContext()
                                                   throws javax.naming.NamingException,
                                                          java.lang.Exception

findJndiObject

protected java.lang.Object findJndiObject()
Get a generic Jndi object. (ctx.lookup(jndiName))

applyDynamicProperties

public void applyDynamicProperties(java.util.Properties dynamicProperties)
applies dynamically in properties. This method applies the jndi related properties in addition to all the standard ones.
Overrides:
applyDynamicProperties in class ConnectionProvider
Parameters:
dynamicProperties - : Properties the dynamic properties to be used by this provider


Copyright © 2003 ORACLE Corp. All Rights Reserved.