oracle.clex.persistence.ejb
Class EJBHomeProvider

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

public class EJBHomeProvider
extends JndiObjectProvider

Provides a specific EJBHome.

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 requisiste properties not in parents:

Example EJB Home Provider in cle-providers.xml:

 <?xml version="1.0" standalone="yes"?>
 <!DOCTYPE cle-providers SYSTEM "http://xmlns.oracle.com/ias/mvc/cle-providers.dtd">
 <cle-providers>
  <provider name="personnel_ejb" class="oracle.clex.persistence.ejb.EJBHomeProvider">
    <property name="user" value="admin"/>
    <property name="password" value="oracle"/>
    <property name="jndiname" value="PersonnelManager"/>
    <property name="connectionstring" value="ormi://localhost/personnel"/>
    <property name="host" value="localhost"/>
    <property name="contextfactory" value="com.evermind.server.ApplicationClientInitialContextFactory"/>
    <property name="classname" value="oracle.demo.personnel.persistence.ejb_cmp.PersonnelManagerHome"/>
    <property name="persistencebase" value="oracle.demo.personnel.persistence.ejb_cmp"/>
    lt;property name="failover" value=""/>
  </provider>
 </cle-providers>
 

Typical Usage in a Handler:

  public Vector aHandlerMethod(Object sessionId, <ArgumentType> aArgument)
    throws Exception
  {
    MyEJBHome home = (MyEJBHome)getConnection(sessionId);
    MyEJB myEJB = (MyEJB)home.create();
    .... use the ejb here ...
    releaseConnection(sessionId);

    return theResult;
  } // end aHandlerMethod
 

See Also:
Serialized Form

Field Summary
protected  java.lang.String classname
          The classname for the EJBHome that we are looking for.
static java.lang.String CLASSNAME
          Constant for classname
protected  java.lang.String contextFactory
           
static java.lang.String CONTEXTFACTORY
          Constant for contextfactory
protected  javax.ejb.EJBHome homeInterface
          The single Home Interface for this provider.
protected  java.lang.String NON_SSL_LOGIN
           
 
Fields inherited from class oracle.clex.persistence.jndi.JndiObjectProvider
jndiName, JNDINAME, jndiObject
 
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
EJBHomeProvider()
           
EJBHomeProvider(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 connect()
          Get the EJBHome interface for an EJB using its own provider info
protected  javax.ejb.EJBHome createHomeInterface()
           
 java.lang.String getClassname()
           
 java.lang.Object getConnection(java.lang.Object sessionId)
          Returns a connection
 java.lang.Object getConnection(java.lang.Object sessionId, int failover)
          Does nothing...
 java.lang.String getContextFactory()
           
 javax.naming.Context getInitialContext()
          Get an IntitialContext so that we can find the Home Interface.
 boolean isConnected()
          Returns the state of the connection for the Provider
 void releaseConnection(java.lang.Object sessionId)
          Release the connection associated to the sessionId.
 void setClassname(java.lang.String aClassname)
           
 void setContextFactory(java.lang.String aFactoryName)
           
 
Methods inherited from class oracle.clex.persistence.jndi.JndiObjectProvider
applyDynamicProperties, disconnect, findJndiObject, getJndiName, hashCode, isSame, setJndiName
 
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, 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
 

Field Detail

homeInterface

protected javax.ejb.EJBHome homeInterface
The single Home Interface for this provider. This is derived from the properties loaded for this provider.

CLASSNAME

public static final java.lang.String CLASSNAME
Constant for classname

CONTEXTFACTORY

public static final java.lang.String CONTEXTFACTORY
Constant for contextfactory

classname

protected java.lang.String classname
The classname for the EJBHome that we are looking for.

contextFactory

protected java.lang.String contextFactory

NON_SSL_LOGIN

protected java.lang.String NON_SSL_LOGIN
Constructor Detail

EJBHomeProvider

public EJBHomeProvider()

EJBHomeProvider

public EJBHomeProvider(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 JndiObjectProvider

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId)
Returns a connection
Overrides:
getConnection in class JndiObjectProvider

getConnection

public java.lang.Object getConnection(java.lang.Object sessionId,
                                      int failover)
Does nothing... empty implementation
Overrides:
getConnection in class JndiObjectProvider

releaseConnection

public void releaseConnection(java.lang.Object sessionId)
Release the connection associated to the sessionId. Do nothing... the Home is just a factory, so we don't need to.
Overrides:
releaseConnection in class ConnectionProvider

connect

public void connect()
Get the EJBHome interface for an EJB using its own provider info
Overrides:
connect in class JndiObjectProvider

isConnected

public boolean isConnected()
Returns the state of the connection for the Provider

getClassname

public java.lang.String getClassname()

setClassname

public void setClassname(java.lang.String aClassname)

getContextFactory

public java.lang.String getContextFactory()

setContextFactory

public void setContextFactory(java.lang.String aFactoryName)

createHomeInterface

protected javax.ejb.EJBHome createHomeInterface()
                                         throws java.lang.Exception

getInitialContext

public javax.naming.Context getInitialContext()
                                       throws javax.naming.NamingException,
                                              java.lang.Exception
Get an IntitialContext so that we can find the Home Interface.

NOTE: This method first tries to get an InitialContext without programmatically passing environment properties. If that fails to return a valid Context, then and only then are the properties for this provider used. This allows this provider to use a jndi.properties file, for example, to get the environment in a standard way.

Overrides:
getInitialContext in class JndiObjectProvider


Copyright © 2003 ORACLE Corp. All Rights Reserved.