The EJBContext interface provides an instance with access to the container-provided runtime context of an enterprise Bean instance.
This interface is extended by the SessionContext and EntityContext interface to provide additional methods specific to the enterprise Bean type.
getCallerIdentity() Deprecated. Use Principal getCallerPrincipal() instead. | |
getCallerPrincipal() Obtain the java.security.Principal that identifies the caller. | |
getEJBHome() Obtain the enterprise bean's remote home interface. | |
getEJBLocalHome() Obtain the enterprise bean's local home interface. | |
getEnvironment() Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment. | |
getRollbackOnly() Test if the transaction has been marked for rollback only. | |
getUserTransaction() Obtain the transaction demarcation interface. | |
isCallerInRole(java.security.Identity role) Deprecated. Use boolean isCallerInRole(String roleName) instead. | |
isCallerInRole(java.lang.String roleName) Test if the caller has a given security role. | |
setRollbackOnly() Mark the current transaction for rollback. |
publicEJBHomegetEJBHome()
java.lang.IllegalStateException
- if the enterprise bean does not have a remote home interface.publicEJBLocalHomegetEJBLocalHome()
java.lang.IllegalStateException
- if the enterprise bean does not have a local home interface.public java.util.PropertiesgetEnvironment()
Note: If the enterprise bean has no environment properties this method returns an empty java.util.Properties object. This method never returns null.
public java.security.IdentitygetCallerIdentity()
public java.security.PrincipalgetCallerPrincipal()
public booleanisCallerInRole(java.security.Identity role)
This method is deprecated in EJB 1.1. The enterprise bean should use the isCallerInRole(String roleName) method instead.
role
- The java.security.Identity of the role to be tested.public booleanisCallerInRole(java.lang.String roleName)
roleName
- The name of the security role. The role must be one of the security roles that is defined in the deployment descriptor.publicUserTransactiongetUserTransaction() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The Container throws the exception if the instance is not allowed to use the UserTransaction interface (i.e. the instance is of a bean with container-managed transactions).public voidsetRollbackOnly() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).public booleangetRollbackOnly() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- The Container throws the exception if the instance is not allowed to use this method (i.e. the instance is of a bean with bean-managed transactions).