|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ow2.jonas.lib.ejb21.JContext
public abstract class JContext
This class implements javax.ejb.EJBContext class. It may be extended in JSessionContext or JEntityContext
Field Summary | |
---|---|
protected JFactory |
bf
|
static int |
CTX_STATE_ACTIVE
|
static int |
CTX_STATE_COMMITTING
|
static int |
CTX_STATE_FINDING
|
static int |
CTX_STATE_INITIAL
State of this Context This state is used to know if some operation is allowed or not in this context. |
static int |
CTX_STATE_PASSIVE
|
protected EnterpriseBean |
myinstance
|
protected TransactionManager |
tm
|
Constructor Summary | |
---|---|
protected |
JContext(JFactory bf,
EnterpriseBean i)
Constructs a JContext |
Method Summary | |
---|---|
Identity |
getCallerIdentity()
Deprecated. |
Principal |
getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller. |
EJBHome |
getEJBHome()
the enterprise bean's home interface. |
EJBLocalHome |
getEJBLocalHome()
Obtain the enterprise bean's local home interface. |
Properties |
getEnvironment()
Deprecated. |
boolean |
getRollbackOnly()
Tests if the transaction has been marked for rollback only. |
int |
getState()
Get the Instance State |
abstract TimerService |
getTimerService()
Get access to the EJB Timer Service. |
UserTransaction |
getUserTransaction()
Obtains the transaction demarcation interface. |
WorkManager |
getWorkManager()
Get the WorkManager |
boolean |
isCallerInRole(Identity role)
Deprecated. Use boolean isCallerInRole(String roleName) instead. Tests if the caller has a given role. |
boolean |
isCallerInRole(String roleName)
Test if the caller has a given role. |
Object |
lookup(String name)
Lookup object with given name. |
void |
setActive()
|
void |
setCommitting()
|
void |
setFinding()
|
void |
setPassive()
|
void |
setRollbackOnly()
Marks the current transaction for rollback. |
void |
setState(int newState)
Set the instance State |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected EnterpriseBean myinstance
protected final JFactory bf
protected final TransactionManager tm
public static final int CTX_STATE_INITIAL
public static final int CTX_STATE_PASSIVE
public static final int CTX_STATE_ACTIVE
public static final int CTX_STATE_COMMITTING
public static final int CTX_STATE_FINDING
Constructor Detail |
---|
protected JContext(JFactory bf, EnterpriseBean i)
bf
- - the BeanFactoryi
- - the bean instanceMethod Detail |
---|
public void setState(int newState)
public void setPassive()
public void setActive()
public void setCommitting()
public void setFinding()
public int getState()
Exception
public WorkManager getWorkManager()
public Identity getCallerIdentity()
getCallerIdentity
in interface EJBContext
public Principal getCallerPrincipal() throws IllegalStateException
getCallerPrincipal
in interface EJBContext
IllegalStateException
- no security context existspublic EJBHome getEJBHome() throws IllegalStateException
getEJBHome
in interface EJBContext
IllegalStateException
- - if the enterprise bean does not have a local home interface.public EJBLocalHome getEJBLocalHome() throws IllegalStateException
getEJBLocalHome
in interface EJBContext
IllegalStateException
- if the enterprise bean does not have a local home interface.public Properties getEnvironment()
getEnvironment
in interface EJBContext
public boolean getRollbackOnly() throws IllegalStateException
getRollbackOnly
in interface EJBContext
IllegalStateException
- if state is 0public abstract TimerService getTimerService() throws IllegalStateException
getTimerService
in interface EJBContext
IllegalStateException
- Thrown if the instance is not
allowed to use this method (e.g. if the bean is a stateful session bean)public UserTransaction getUserTransaction() throws IllegalStateException
getUserTransaction
in interface EJBContext
IllegalStateException
- Thrown if the instance container does
not make the UserTransaction interface available to the
instance. (not bean managed)public boolean isCallerInRole(Identity role)
isCallerInRole
in interface EJBContext
role
- - The java.security.Identity of the role to be tested.
public boolean isCallerInRole(String roleName) throws IllegalStateException
isCallerInRole
in interface EJBContext
roleName
- The name of the security role.
The role must be one of the security-role-ref that is defined in the
deployment descriptor.
IllegalStateException
- Security service not startedpublic void setRollbackOnly() throws IllegalStateException
setRollbackOnly
in interface EJBContext
IllegalStateException
- in getRollbackOnly() methodpublic Object lookup(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 |