|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.easybeans.container.session.EasyBeansSessionContext<BeanType>
BeanType
- Could be a stateless or stateful.public class EasyBeansSessionContext<BeanType extends EasyBeansSB>
Defines the Session Context used by Stateless and Stateful beans.
Nested Class Summary | |
---|---|
(package private) class |
EasyBeansSessionContext.DummyPrincipal
Dummy class for handling Principal. |
(package private) class |
EasyBeansSessionContext.DummyTimerService
Dummy class for handling Timer Service. |
Field Summary | |
---|---|
private BeanType |
bean
Reference to the bean. |
private javax.transaction.Transaction |
beanTransaction
Transaction used by this bean. |
private static java.lang.String |
JAVA_COMP_ENV
java:comp/env prefix. |
private TransactionManagementType |
transactionManagementType
Type of transaction. |
private javax.transaction.TransactionManager |
transactionManager
Reference to the transaction manager. |
Constructor Summary | |
---|---|
EasyBeansSessionContext(BeanType bean)
Build a new Session context. |
Method Summary | |
---|---|
BeanType |
getBean()
Gets the bean of this context. |
javax.transaction.Transaction |
getBeanTransaction()
Gets the transaction used by this bean. |
java.security.Identity |
getCallerIdentity()
Deprecated. |
java.security.Principal |
getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller. |
javax.ejb.EJBHome |
getEJBHome()
Obtain the enterprise bean's remote home interface. |
javax.ejb.EJBLocalHome |
getEJBLocalHome()
Obtain the enterprise bean's local home interface. |
javax.ejb.EJBLocalObject |
getEJBLocalObject()
Obtain a reference to the EJB local object that is associated with the instance. |
javax.ejb.EJBObject |
getEJBObject()
Obtain a reference to the EJB object that is currently associated with the instance. |
java.util.Properties |
getEnvironment()
Deprecated. |
javax.xml.rpc.handler.MessageContext |
getMessageContext()
Obtain a reference to the JAX-RPC MessageContext. |
boolean |
getRollbackOnly()
Test if the transaction has been marked for rollback only. |
javax.ejb.TimerService |
getTimerService()
Get access to the EJB Timer Service. |
javax.transaction.UserTransaction |
getUserTransaction()
Obtain the transaction demarcation interface. |
boolean |
isCallerInRole(java.security.Identity role)
Deprecated. |
boolean |
isCallerInRole(java.lang.String roleName)
Test if the caller has a given security role. |
java.lang.Object |
lookup(java.lang.String name)
Lookup object with given name. |
void |
setBeanTransaction(javax.transaction.Transaction beanTransaction)
Sets the transaction used by this bean. |
void |
setRollbackOnly()
Mark the current transaction for rollback. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String JAVA_COMP_ENV
private BeanType extends EasyBeansSB bean
private javax.transaction.TransactionManager transactionManager
private TransactionManagementType transactionManagementType
private javax.transaction.Transaction beanTransaction
Constructor Detail |
---|
public EasyBeansSessionContext(BeanType bean)
bean
- the bean on which we are linked.Method Detail |
---|
public javax.transaction.Transaction getBeanTransaction()
public void setBeanTransaction(javax.transaction.Transaction beanTransaction)
beanTransaction
- the bean transaction.public BeanType getBean()
public javax.ejb.EJBLocalObject getEJBLocalObject() throws java.lang.IllegalStateException
getEJBLocalObject
in interface javax.ejb.SessionContext
java.lang.IllegalStateException
- - Thrown if the instance invokes
this method while the instance is in a state that does not allow
the instance to invoke this method, or if the instance does not
have a local interface.public javax.ejb.EJBObject getEJBObject() throws java.lang.IllegalStateException
getEJBObject
in interface javax.ejb.SessionContext
java.lang.IllegalStateException
- - Thrown if the instance invokes
this method while the instance is in a state that does not allow
the instance to invoke this method, or if the instance does not
have a remote interface.public javax.xml.rpc.handler.MessageContext getMessageContext() throws java.lang.IllegalStateException
getMessageContext
in interface javax.ejb.SessionContext
java.lang.IllegalStateException
- - Thrown if this method is
invoked while the instance is in a state that does not allow
access to this method.public javax.ejb.EJBHome getEJBHome() throws java.lang.IllegalStateException
getEJBHome
in interface EJBContext
java.lang.IllegalStateException
- if the enterprise bean does not have a
remote home interface.public javax.ejb.EJBLocalHome getEJBLocalHome() throws java.lang.IllegalStateException
getEJBLocalHome
in interface EJBContext
java.lang.IllegalStateException
- - if the enterprise bean does not have a
local home interface.@Deprecated public java.util.Properties getEnvironment()
getEnvironment
in interface EJBContext
@Deprecated public java.security.Identity getCallerIdentity()
getCallerIdentity
in interface EJBContext
public java.security.Principal getCallerPrincipal()
getCallerPrincipal
in interface EJBContext
@Deprecated public boolean isCallerInRole(java.security.Identity role)
isCallerInRole
in interface EJBContext
role
- The java.security.Identity of the role to be tested.
public boolean isCallerInRole(java.lang.String roleName)
isCallerInRole
in interface EJBContext
roleName
- The name of the security role. The role must be one of
the security roles that is defined in the deployment descriptor.
public javax.transaction.UserTransaction getUserTransaction() throws java.lang.IllegalStateException
getUserTransaction
in interface EJBContext
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 void setRollbackOnly() throws java.lang.IllegalStateException
setRollbackOnly
in interface EJBContext
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 boolean getRollbackOnly() throws java.lang.IllegalStateException
getRollbackOnly
in interface EJBContext
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 javax.ejb.TimerService getTimerService() throws java.lang.IllegalStateException
getTimerService
in interface EJBContext
java.lang.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)public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object lookup(java.lang.String name)
lookup
in interface EJBContext
name
- given name
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |