cuba.ejb
Class EJB2ComponentContext

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

public class EJB2ComponentContext
extends AbstractEJBComponentContext


Nested Class Summary
 
Nested classes/interfaces inherited from interface cuba.ContextI
ContextI.Type
 
Field Summary
 
Fields inherited from class cuba.ejb.AbstractEJBComponentContext
context
 
Constructor Summary
EJB2ComponentContext(javax.ejb.SessionContext context)
           
 
Method Summary
 ClientContextI getClientContext()
          Create a client context from a component context which provides external access to the same container which the current component resides in.
 java.lang.Object getComponent(java.lang.String name)
          Looks up a component refered to by a symbolic name.
 
Methods inherited from class cuba.ejb.AbstractEJBComponentContext
getCallerName, getDataSource, getEnvironment, getLocalContext, getRollbackOnly, getTransaction, getType, isCallerInRole, popCall, pushCall, setRollbackOnly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJB2ComponentContext

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

getClientContext

public ClientContextI getClientContext()
Description copied from interface: ComponentContextI
Create a client context from a component context which provides external access to the same container which the current component resides in. This function is especially required to perform global lookups from inside the container, e.g. when integrating things like persistence management frameworks.

Returns:
The client context

getComponent

public 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.

Specified by:
getComponent in interface ContextI
Specified by:
getComponent in class AbstractEJBComponentContext
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.