cuba
Interface ComponentContextI

All Superinterfaces:
ContextI
All Known Implementing Classes:
AbstractComponentContext, AbstractEJBComponentContext, EJB2ComponentContext, EJB3ComponentContext, WiredComponentContext

public interface ComponentContextI
extends ContextI

General interface type used to lookup components and resources from within another component. Component and resource lookups are always component-local. For global lookups a component can get a client view by function getClientContext(). See implementing classes for details.

Author:
Jan Lessner

Nested Class Summary
 
Nested classes/interfaces inherited from interface cuba.ContextI
ContextI.Type
 
Method Summary
 java.lang.String getCallerName()
           
 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 getEnvironment(java.lang.String name)
          Looks up an environment entry refered to by a symbolic name.
 boolean getRollbackOnly()
           
 boolean isCallerInRole(java.lang.String roleName)
           
 void setRollbackOnly()
           
 
Methods inherited from interface cuba.ContextI
getComponent, getDataSource, getTransaction, getType
 

Method Detail

setRollbackOnly

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

getRollbackOnly

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

isCallerInRole

boolean isCallerInRole(java.lang.String roleName)

getCallerName

java.lang.String getCallerName()

getEnvironment

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.

getClientContext

ClientContextI getClientContext()
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