org.objectweb.jonas_ejb.container.JContext Class Reference

Inherited by org.objectweb.jonas_ejb.container.JEntityContext, and org.objectweb.jonas_ejb.container.JSessionContext.

Inheritance diagram for org.objectweb.jonas_ejb.container.JContext:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.jonas_ejb.container.JContext:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JContext (JFactory bf, EnterpriseBean i)
void setState (int newState)
int getState ()
Identity getCallerIdentity ()
Principal getCallerPrincipal () throws IllegalStateException
EJBHome getEJBHome () throws IllegalStateException
EJBLocalHome getEJBLocalHome () throws IllegalStateException
Properties getEnvironment ()
boolean getRollbackOnly () throws IllegalStateException
abstract TimerService getTimerService () throws IllegalStateException
UserTransaction getUserTransaction () throws IllegalStateException
boolean isCallerInRole (Identity role)
boolean isCallerInRole (String roleName) throws IllegalStateException
void setRollbackOnly () throws IllegalStateException

Package Attributes

int instanceState = 0

Detailed Description

This class implements javax.ejb.EJBContext class. It may be extended in JSessionContext or JEntityContext
Author:
Philippe Coq, Philippe Durieux, Jeff Mesnil (security)

Florent Benoit (JACC security)

Definition at line 57 of file JContext.java.


Constructor & Destructor Documentation

org.objectweb.jonas_ejb.container.JContext.JContext JFactory  bf,
EnterpriseBean  i
 

Constructs a JContext

Parameters:
bf - the BeanFactory
i - the bean instance

Definition at line 87 of file JContext.java.

References org.objectweb.jonas_ejb.container.JFactory.cont, org.objectweb.jonas_ejb.container.JFactory.getContainer(), org.objectweb.jonas_ejb.container.JContainer.getPermissionManager(), org.objectweb.jonas_ejb.container.JFactory.getTransactionManager(), and org.objectweb.jonas_ejb.container.JContainer.tm.

Here is the call graph for this function:


Member Function Documentation

Identity org.objectweb.jonas_ejb.container.JContext.getCallerIdentity  ) 
 

Obtains the java.security.Identity of the caller.

Deprecated:
Returns:
The Identity object that identifies the caller.

Definition at line 125 of file JContext.java.

Principal org.objectweb.jonas_ejb.container.JContext.getCallerPrincipal  )  throws IllegalStateException
 

Obtain the java.security.Principal that identifies the caller. throws a java.lang.IllegalStateException if there is no security context available

Returns:
The Principal object that identifies the caller.
Exceptions:
IllegalStateException no security context exists

Reimplemented in org.objectweb.jonas_ejb.container.JStatelessContext.

Definition at line 136 of file JContext.java.

References org.objectweb.jonas_ejb.container.JFactory.dd, org.objectweb.jonas_ejb.container.PrincipalFactory.getCallerPrincipal(), org.objectweb.jonas_ejb.container.JContainer.getPrincipalFactory(), org.objectweb.jonas_ejb.deployment.api.BeanDesc.getRunAsRole(), and org.objectweb.jonas_ejb.container.JContext.getState().

Here is the call graph for this function:

EJBHome org.objectweb.jonas_ejb.container.JContext.getEJBHome  )  throws IllegalStateException
 

the enterprise bean's home interface.

Returns:
The enterprise bean's home interface.
Exceptions:
IllegalStateException - if the enterprise bean does not have a local home interface.

Definition at line 159 of file JContext.java.

EJBLocalHome org.objectweb.jonas_ejb.container.JContext.getEJBLocalHome  )  throws IllegalStateException
 

Obtain the enterprise bean's local home interface.

Returns:
The enterprise bean's local home interface.
Exceptions:
IllegalStateException if the enterprise bean does not have a local home interface.

Definition at line 168 of file JContext.java.

References org.objectweb.jonas_ejb.container.JFactory.dd, and org.objectweb.jonas_ejb.deployment.api.BeanDesc.hasDefinedLocalInterface().

Here is the call graph for this function:

Properties org.objectweb.jonas_ejb.container.JContext.getEnvironment  ) 
 

Obtains the enterprise bean's environment properties for EJB 1.0 style. (Conform to EJB 1.1 specification for a container chooses to provide support for EJB 1.0 style environment properties. Cf EJB 1.1 Chapter 14.5, pages 216-217) Note: If the enterprise bean has no environment properties, this method returns an empty java.util.Properties object. This method never returns null.

Deprecated:
Returns:
The environment properties for the enterprise bean.

Definition at line 185 of file JContext.java.

References org.objectweb.jonas_ejb.container.JFactory.getEjb10Environment().

Here is the call graph for this function:

boolean org.objectweb.jonas_ejb.container.JContext.getRollbackOnly  )  throws IllegalStateException
 

Tests if the transaction has been marked for rollback only.

Returns:
true if transaction will rollback

Reimplemented in org.objectweb.jonas_ejb.container.JSessionContext.

Definition at line 194 of file JContext.java.

References org.objectweb.jonas_ejb.container.JContext.getState().

Referenced by org.objectweb.jonas_ejb.container.JContext.setRollbackOnly().

Here is the call graph for this function:

int org.objectweb.jonas_ejb.container.JContext.getState  ) 
 

Get the Instance State

Exceptions:
Exception 

Definition at line 111 of file JContext.java.

References org.objectweb.jonas_ejb.container.JContext.instanceState.

Referenced by org.objectweb.jonas_ejb.container.JStatelessContext.createTimer(), org.objectweb.jonas_ejb.container.JStatelessContext.getCallerPrincipal(), org.objectweb.jonas_ejb.container.JContext.getCallerPrincipal(), org.objectweb.jonas_ejb.container.JSessionContext.getRollbackOnly(), org.objectweb.jonas_ejb.container.JContext.getRollbackOnly(), org.objectweb.jonas_ejb.container.JTimerHandle.getTimer(), org.objectweb.jonas_ejb.container.JStatelessContext.getTimers(), org.objectweb.jonas_ejb.container.JStatelessContext.getTimerService(), org.objectweb.jonas_ejb.container.JEntityContext.getTimerService(), org.objectweb.jonas_ejb.container.JContext.getUserTransaction(), org.objectweb.jonas_ejb.container.JStatelessContext.isCallerInRole(), and org.objectweb.jonas_ejb.container.JContext.isCallerInRole().

abstract TimerService org.objectweb.jonas_ejb.container.JContext.getTimerService  )  throws IllegalStateException [pure virtual]
 

Get access to the EJB Timer Service.

Returns:
the EJB Timer Service
Exceptions:
IllegalStateException Thrown if the instance is not allowed to use this method (e.g. if the bean is a stateful session bean)

Implemented in org.objectweb.jonas_ejb.container.JEntityContext, org.objectweb.jonas_ejb.container.JStatefulContext, and org.objectweb.jonas_ejb.container.JStatelessContext.

UserTransaction org.objectweb.jonas_ejb.container.JContext.getUserTransaction  )  throws IllegalStateException
 

Obtains the transaction demarcation interface.

Returns:
The UserTransaction interface that the enterprise bean instance can use for transaction demarcation.
Exceptions:
IllegalStateException Thrown if the instance container does not make the UserTransaction interface available to the instance. (not bean managed)

Definition at line 242 of file JContext.java.

References org.objectweb.jonas_ejb.container.JContext.getState(), and org.objectweb.jonas_ejb.container.JFactory.isTxBeanManaged().

Here is the call graph for this function:

boolean org.objectweb.jonas_ejb.container.JContext.isCallerInRole String  roleName  )  throws IllegalStateException
 

Test if the caller has a given role.

Parameters:
roleName The name of the security role. The role must be one of the security-role-ref that is defined in the deployment descriptor.
Returns:
True if the caller has the specified role.
Exceptions:
IllegalStateException Security service not started

Reimplemented in org.objectweb.jonas_ejb.container.JStatelessContext.

Definition at line 274 of file JContext.java.

References org.objectweb.jonas_ejb.container.JFactory.dd, org.objectweb.jonas_ejb.container.JFactory.getEJBName(), org.objectweb.jonas_lib.deployment.api.SecurityRoleRefDesc.getRoleName(), org.objectweb.jonas_ejb.deployment.api.BeanDesc.getRunAsRole(), org.objectweb.jonas_ejb.deployment.api.BeanDesc.getSecurityRoleRefDescList(), org.objectweb.jonas_ejb.container.JContext.getState(), org.objectweb.jonas_ejb.container.PermissionManager.isCallerInRole(), and org.objectweb.jonas_ejb.deployment.api.BeanDesc.logger.

Here is the call graph for this function:

boolean org.objectweb.jonas_ejb.container.JContext.isCallerInRole Identity  role  ) 
 

Deprecated:
Use boolean isCallerInRole(String roleName) instead. Tests if the caller has a given role.
Parameters:
role - The java.security.Identity of the role to be tested.
Returns:
True if the caller has the specified role.

Definition at line 261 of file JContext.java.

void org.objectweb.jonas_ejb.container.JContext.setRollbackOnly  )  throws IllegalStateException
 

Marks the current transaction for rollback. The transaction will become permanently marked for rollback.

Definition at line 326 of file JContext.java.

References org.objectweb.jonas_ejb.container.JContext.getRollbackOnly().

Referenced by org.objectweb.jonas_ejb.container.JEntitySwitchDB.notifyWriting(), and org.objectweb.jonas_ejb.container.JEntitySwitchCRU.notifyWriting().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JContext.setState int  newState  ) 
 

Set the instance State

Definition at line 102 of file JContext.java.

References org.objectweb.jonas_ejb.container.JContext.instanceState.

Referenced by org.objectweb.jonas_ejb.container.JEntityContext.activate(), org.objectweb.jonas_ejb.container.JStatefulContext.afterCompletion(), org.objectweb.jonas_ejb.container.JEntityFactory.createNewInstance(), and org.objectweb.jonas_ejb.container.JEntityContext.passivate().


Member Data Documentation

int org.objectweb.jonas_ejb.container.JContext.instanceState = 0 [package]
 

State of this Context 0 = init, 1 = setContext done, 2 = ejbCreate done.

Definition at line 76 of file JContext.java.

Referenced by org.objectweb.jonas_ejb.container.JContext.getState(), and org.objectweb.jonas_ejb.container.JContext.setState().


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:10:04 2005 for JOnAS by  doxygen 1.3.9.1