cuba.ejb
Class AbstractEJBComponentContext

java.lang.Object
  extended by cuba.AbstractComponentContext
      extended by cuba.ejb.AbstractEJBComponentContext
All Implemented Interfaces:
ComponentContextI, ContextI
Direct Known Subclasses:
EJB2ComponentContext, EJB3ComponentContext

public abstract class AbstractEJBComponentContext
extends AbstractComponentContext

Author:
Arnold Kmpaczyk

Nested Class Summary
 
Nested classes/interfaces inherited from interface cuba.ContextI
ContextI.Type
 
Field Summary
protected  javax.ejb.SessionContext context
           
 
Constructor Summary
AbstractEJBComponentContext(javax.ejb.SessionContext context)
           
 
Method Summary
 java.lang.String getCallerName()
           
abstract  java.lang.Object getComponent(java.lang.String name)
          Looks up a component refered to by a symbolic name.
 javax.sql.DataSource getDataSource(java.lang.String name)
          Looks up an SQL database refered to by a symbolic name.
 java.lang.Object getEnvironment(java.lang.String name)
          Looks up an environment entry refered to by a symbolic name.
protected  javax.naming.Context getLocalContext()
           
 boolean getRollbackOnly()
           
 javax.transaction.UserTransaction getTransaction()
          Provide access to a user transaction
 int getType()
          Returns the type of context, to let the context holder perform operations depending on the environment it is working in.
 boolean isCallerInRole(java.lang.String roleName)
           
 void popCall()
          Nothing to do here.
 void pushCall()
          Nothing to do here.
 void setRollbackOnly()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface cuba.ComponentContextI
getClientContext
 

Field Detail

context

protected javax.ejb.SessionContext context
Constructor Detail

AbstractEJBComponentContext

public AbstractEJBComponentContext(javax.ejb.SessionContext context)
Method Detail

getType

public int getType()
Description copied from interface: ContextI
Returns the type of context, to let the context holder perform operations depending on the environment it is working in.


getComponent

public abstract java.lang.Object getComponent(java.lang.String name)
                                       throws ConstructionException,
                                              ReferenceException
Description copied from interface: ContextI
Looks up a component refered to by a symbolic name. The lookup is performed either in a global name space or in a local one depending on the type of context used.

Parameters:
name - The symbolic name of the component to look up
Returns:
A proxy object, implementing the component's interface. The return value must be casted to the required type.
Throws:
ConstructionException - if the container failed to provide the required component
ReferenceException - if the provided symbolic name cannot be resolved.

getTransaction

public javax.transaction.UserTransaction getTransaction()
Description copied from interface: ContextI
Provide access to a user transaction


setRollbackOnly

public void setRollbackOnly()
                     throws javax.transaction.SystemException
Throws:
javax.transaction.SystemException

getRollbackOnly

public boolean getRollbackOnly()
                        throws javax.transaction.SystemException
Throws:
javax.transaction.SystemException

isCallerInRole

public boolean isCallerInRole(java.lang.String roleName)

getCallerName

public java.lang.String getCallerName()

getDataSource

public javax.sql.DataSource getDataSource(java.lang.String name)
                                   throws ConstructionException,
                                          ReferenceException
Description copied from interface: ContextI
Looks up an SQL database refered to by a symbolic name. The lookup is performed either in a global name space or in a local one depending on the type of context used.

Parameters:
name - The symbolic name of the SQL source to look up
Returns:
A proxy object, providing access to the database.
Throws:
ConstructionException - if the container failed to provide the required SQL database
ReferenceException - if the provided symbolic name cannot be resolved.

getLocalContext

protected javax.naming.Context getLocalContext()
                                        throws javax.naming.NamingException
Throws:
javax.naming.NamingException

getEnvironment

public java.lang.Object getEnvironment(java.lang.String name)
                                throws ReferenceException
Looks up an environment entry refered to by a symbolic name.

Parameters:
name - The symbolic name of the environment entry to look up
Returns:
The enrtie's value. The return value must be casted to the required type.
Throws:
ReferenceException - if the provided symbolic name cannot be resolved.

pushCall

public void pushCall()
              throws ComponentException
Nothing to do here. Call-chain management is performed by EJB container

Specified by:
pushCall in class AbstractComponentContext
Throws:
ComponentException

popCall

public void popCall()
             throws ComponentException
Nothing to do here. Call-chain management is performed by EJB container

Specified by:
popCall in class AbstractComponentContext
Throws:
ComponentException