Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


oracle.jbo.server.ejb.sb
Class ServiceBean

java.lang.Object
  |
  +--oracle.jbo.server.ejb.SessionBeanImpl
        |
        +--oracle.jbo.server.ejb.sb.ServiceBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, java.io.Serializable, javax.ejb.SessionBean
Direct Known Subclasses:
BeanManagedServiceBean, ContainerManagedServiceBeanBase

public abstract class ServiceBean
extends SessionBeanImpl

BaseClass for Application Module Service Session Bean. Service beans aggregate an application module for exposing any business logic as a session bean.

Subclasses must provide a TransactionHandlerFactory implementation for associating the appmodule transaction with the bean transaction.

See Also:
Serialized Form

Field Summary

 

Fields inherited from class oracle.jbo.server.ejb.SessionBeanImpl
mApplicationModule

 

Constructor Summary
ServiceBean()
           

 

Method Summary
protected  void connectToDataSource()
          Convenenince method for acquiring the jdbc connection from the dataSource name specified in useDataSource.
protected  void createApplicationModule(java.lang.String amDefName)
          Convenience method for creating the aggregated application module instance.
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  void createApplicationModule(java.lang.String amDefName, java.lang.String configName)
          Convenience method for creating the aggregated application module instance using a LOCAL mode configuration.
protected abstract  TransactionHandlerFactory createTransactionHandlerFactory()
           
protected  void disconnectFromDataSource()
          Releases the jdbc connection by acquired by #connectToDataSource().
protected  void postApplicationModuleCreate()
          Called after creating the appmodule.
 void useDataSource(java.lang.String dataSourceName)
          Set the JNDI name of the dataSource used for acquiring the jdbc connection.

 

Methods inherited from class oracle.jbo.server.ejb.SessionBeanImpl
ejbActivate, ejbPassivate, ejbRemove, getApplicationModule, getSessionContext, removeApplicationModule, setSessionContext

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Constructor Detail

ServiceBean

public ServiceBean()
Method Detail

createTransactionHandlerFactory

protected abstract TransactionHandlerFactory createTransactionHandlerFactory()

createApplicationModule

protected void createApplicationModule(java.lang.String amDefName,
                                       java.lang.String configName)
                                throws javax.ejb.CreateException
Convenience method for creating the aggregated application module instance using a LOCAL mode configuration.
Parameters:
amDefName - Fully qaulified appmodule definition name
configName -
javax.ejb.CreateException

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.
javax.ejb.CreateException

createApplicationModule

protected void createApplicationModule(java.lang.String amDefName)
                                throws javax.ejb.CreateException
Convenience method for creating the aggregated application module instance. This method creates the the aggregated appmodule.
Parameters:
amDefName - Fully qaulified appmodule definition name
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.

connectToDataSource

protected void connectToDataSource()
                            throws JboException
Convenenince method for acquiring the jdbc connection from the dataSource name specified in useDataSource.
JboException
See Also:
useDataSource(String), Transaction.connectToDataSource(Hashtable, String, boolean)

disconnectFromDataSource

protected void disconnectFromDataSource()
                                 throws JboException
Releases the jdbc connection by acquired by #connectToDataSource().
JboException
See Also:
Transaction.disconnect()

Oracle9i Business Components for Java API Reference
Oracle9i Jdeveloper (9.0.4)
B10391-01


 

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