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

oracle.jbo.server.ejb
Class SessionBeanImpl

java.lang.Object
  extended byoracle.jbo.server.ejb.SessionBeanImpl
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean
Direct Known Subclasses:
LocalApplicationModuleImpl, ServiceBean, StatefulSessionBeanImpl, StatelessSessionBeanImpl

public abstract class SessionBeanImpl
extends java.lang.Object
implements javax.ejb.SessionBean

BaseClass for Session Bean implementation. Aggregates an application module for exposing any business logic as a session bean.

See Also:
Serialized Form

Field Summary
protected  ApplicationModuleImpl mApplicationModule
           
 
Constructor Summary
SessionBeanImpl()
           
 
Method Summary
protected  void connectToDataSource()
          Convenenince method for acquiring the jdbc connection from the dataSource name specified in useDataSource.
protected  void createApplicationModule(java.util.Hashtable env)
           
protected  void createApplicationModule(java.lang.String amDefName, java.util.Hashtable initialContextEnv)
          Convenience method for creating the aggregated application module instance using the jndi environment properties.
protected  TransactionHandlerFactory createTransactionHandlerFactory()
           
protected  void disconnectFromDataSource()
          Releases the jdbc connection by acquired by #connectToDataSource().
 ServiceMessage doMessage(ServiceMessage msg)
           
 void ejbActivate()
          Null implementation of SessionBean interface.
 void ejbPassivate()
          Null implementation of SessionBean interface.
 void ejbRemove()
          Implementation of SessionBean.ejbRemove().
protected  ApplicationModule getApplicationModule()
          Returns the appmodule instance created by createApplicationModule() method
protected  java.lang.String getApplicationModuleDefName()
           
protected  java.lang.String getConfigurationName()
           
protected  javax.ejb.SessionContext getSessionContext()
          Returns the SessionContext set by setSessionContext()
protected  int getTransactionTimeOut()
           
protected  boolean isJboBean()
           
protected  boolean isTransactionManagedByBean()
           
protected  void postApplicationModuleCreate()
          Called after creating the appmodule.
protected  void removeApplicationModule()
          Convenience method for removing the aggregated application module instance.
protected  void setApplicationModuleDefName(java.lang.String amDefName)
           
protected  void setConfigurationName(java.lang.String configName)
           
protected  void setCurrentSessionContext()
           
 void setSessionContext(javax.ejb.SessionContext ctx)
          Implementation of SessionBean interface.
 void useDataSource(java.lang.String dataSourceName)
          Set the JNDI name of the dataSource used for acquiring the jdbc connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mApplicationModule

protected transient ApplicationModuleImpl mApplicationModule
Constructor Detail

SessionBeanImpl

public SessionBeanImpl()
Method Detail

ejbActivate

public void ejbActivate()
Null implementation of SessionBean interface.

Specified by:
ejbActivate in interface javax.ejb.SessionBean

ejbPassivate

public void ejbPassivate()
Null implementation of SessionBean interface.

Specified by:
ejbPassivate in interface javax.ejb.SessionBean

setSessionContext

public void setSessionContext(javax.ejb.SessionContext ctx)
Implementation of SessionBean interface.

Specified by:
setSessionContext in interface javax.ejb.SessionBean

ejbRemove

public void ejbRemove()
Implementation of SessionBean.ejbRemove(). Calls removeApplicationModule to remove application module

Specified by:
ejbRemove in interface javax.ejb.SessionBean

getSessionContext

protected javax.ejb.SessionContext getSessionContext()
Returns the SessionContext set by setSessionContext()


getApplicationModule

protected ApplicationModule getApplicationModule()
Returns the appmodule instance created by createApplicationModule() method

Returns:
The aggregated appmodule reference

removeApplicationModule

protected void removeApplicationModule()
Convenience method for removing the aggregated application module instance.


isTransactionManagedByBean

protected boolean isTransactionManagedByBean()

getTransactionTimeOut

protected int getTransactionTimeOut()

isJboBean

protected boolean isJboBean()

createApplicationModule

protected void createApplicationModule(java.util.Hashtable env)
                                throws javax.ejb.CreateException
Throws:
javax.ejb.CreateException

doMessage

public ServiceMessage doMessage(ServiceMessage msg)
                         throws ServiceException
Throws:
ServiceException

connectToDataSource

protected void connectToDataSource()
                            throws JboException
Convenenince method for acquiring the jdbc connection from the dataSource name specified in useDataSource.

Throws:
JboException
See Also:
useDataSource(String), Transaction.connectToDataSource(Hashtable, String, boolean)

disconnectFromDataSource

protected void disconnectFromDataSource()
                                 throws JboException
Releases the jdbc connection by acquired by #connectToDataSource().

Throws:
JboException
See Also:
Transaction.disconnect()

createApplicationModule

protected void createApplicationModule(java.lang.String amDefName,
                                       java.util.Hashtable initialContextEnv)
                                throws javax.ejb.CreateException
Convenience method for creating the aggregated application module instance using the jndi environment properties.

Parameters:
amDefName - Fully qaulified appmodule definition name
initialContextEnv - The initial context environment used to create the aggregated appmodule in local mode.
Throws:
javax.ejb.CreateException

postApplicationModuleCreate

protected void postApplicationModuleCreate()
Called after creating the appmodule. Subclasses can extend this method to perform other initialization after the appmodule is created.


useDataSource

public void useDataSource(java.lang.String dataSourceName)
Set the JNDI name of the dataSource used for acquiring the jdbc connection. JDBC connection is acquired when the transaction is started

Parameters:
dataSourceName - The JNDI name of the dataSource. For OC4J this should be ejb-location of datasource defined in data-sources.xml.

createTransactionHandlerFactory

protected TransactionHandlerFactory createTransactionHandlerFactory()

getApplicationModuleDefName

protected final java.lang.String getApplicationModuleDefName()

getConfigurationName

protected java.lang.String getConfigurationName()

setApplicationModuleDefName

protected final void setApplicationModuleDefName(java.lang.String amDefName)

setConfigurationName

protected void setConfigurationName(java.lang.String configName)

setCurrentSessionContext

protected void setCurrentSessionContext()

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

 

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