|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EJBContext
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, EntityContext, and MessageDrivenContext interfaces to provide additional methods specific to the enterprise interface Bean type.
Method Summary | |
---|---|
java.security.Identity |
getCallerIdentity()
Deprecated. Use Principal getCallerPrincipal() instead. |
java.security.Principal |
getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller. |
java.util.Map<java.lang.String,java.lang.Object> |
getContextData()
Returns the context data associated with this invocation or lifecycle callback. |
EJBHome |
getEJBHome()
Obtain the enterprise bean's remote home interface. |
EJBLocalHome |
getEJBLocalHome()
Obtain the enterprise bean's local home interface. |
java.util.Properties |
getEnvironment()
Deprecated. Use the JNDI naming context java:comp/env to access enterprise bean's environment. |
boolean |
getRollbackOnly()
Test if the transaction has been marked for rollback only. |
TimerService |
getTimerService()
Get access to the EJB Timer Service. |
UserTransaction |
getUserTransaction()
Obtain the transaction demarcation interface. |
boolean |
isCallerInRole(java.security.Identity role)
Deprecated. Use boolean isCallerInRole(String roleName) instead. |
boolean |
isCallerInRole(java.lang.String roleName)
Test if the caller has a given security role. |
java.lang.Object |
lookup(java.lang.String name)
Lookup a resource within the java: namespace. |
void |
setRollbackOnly()
Mark the current transaction for rollback. |
Method Detail |
---|
EJBHome getEJBHome()
java.lang.IllegalStateException
- if the enterprise bean
does not have a remote home interface.EJBLocalHome getEJBLocalHome()
java.lang.IllegalStateException
- if the enterprise bean
does not have a local home interface.java.util.Properties getEnvironment()
Note: If the enterprise bean has no environment properties this method returns an empty java.util.Properties object. This method never returns null.
java.security.Identity getCallerIdentity()
java.security.Principal getCallerPrincipal()
IllegalStateException
- The Container throws the exception
if the instance is not allowed to call this method.boolean isCallerInRole(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.
boolean isCallerInRole(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.
IllegalStateException
- The Container throws the exception
if the instance is not allowed to call this method.UserTransaction getUserTransaction() throws java.lang.IllegalStateException
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).void setRollbackOnly() throws java.lang.IllegalStateException
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).boolean getRollbackOnly() throws java.lang.IllegalStateException
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).TimerService getTimerService() throws java.lang.IllegalStateException
IllegalStateException
- The Container throws the exception
if the instance is not allowed to use this method (e.g. if the bean
is a stateful session bean)java.lang.Object lookup(java.lang.String name)
name
- Name of the entry
java.lang.IllegalArgumentException
- The Container throws the exception
if the given name does not match an entry within the component's
environment.java.util.Map<java.lang.String,java.lang.Object> getContextData()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 4-June-2010 04:34