org.apache.openejb.core
Class BaseContext

java.lang.Object
  extended by org.apache.openejb.core.BaseContext
All Implemented Interfaces:
Serializable, javax.ejb.EJBContext
Direct Known Subclasses:
BaseSessionContext, EntityContext, MdbContext

public abstract class BaseContext
extends Object
implements javax.ejb.EJBContext, Serializable

Version:
$Rev: 1153797 $ $Date: 2011-08-04 09:09:44 +0000 (Thu, 04 Aug 2011) $
See Also:
Serialized Form

Nested Class Summary
static class BaseContext.Call
           
static class BaseContext.State
           
 class BaseContext.UserTransactionWrapper
           
 
Field Summary
protected  SecurityService securityService
           
protected  UserTransaction userTransaction
           
 
Constructor Summary
protected BaseContext(SecurityService securityService)
           
protected BaseContext(SecurityService securityService, UserTransaction userTransaction)
           
 
Method Summary
abstract  void check(BaseContext.Call call)
           
 Identity getCallerIdentity()
           
 Principal getCallerPrincipal()
           
protected  Principal getCallerPrincipal(SecurityService securityService)
           
 Map<String,Object> getContextData()
           
 javax.ejb.EJBHome getEJBHome()
           
 javax.ejb.EJBLocalHome getEJBLocalHome()
           
 Properties getEnvironment()
           
 boolean getRollbackOnly()
           
 javax.ejb.TimerService getTimerService()
           
 UserTransaction getUserTransaction()
           
 UserTransaction getUserTransaction(UserTransaction userTransaction)
           
protected  IllegalStateException illegal(BaseContext.Call call, Operation operation)
           
 boolean isCallerInRole(Identity identity)
           
protected  boolean isCallerInRole(SecurityService securityService, String roleName)
           
 boolean isCallerInRole(String s)
           
 boolean isTimerMethodAllowed()
           
 boolean isUserTransactionAccessAllowed()
           
 Object lookup(String name)
           
 void setRollbackOnly()
           
protected  Object writeReplace()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

securityService

protected final SecurityService securityService

userTransaction

protected final UserTransaction userTransaction
Constructor Detail

BaseContext

protected BaseContext(SecurityService securityService)

BaseContext

protected BaseContext(SecurityService securityService,
                      UserTransaction userTransaction)
Method Detail

check

public abstract void check(BaseContext.Call call)

illegal

protected IllegalStateException illegal(BaseContext.Call call,
                                        Operation operation)

getContextData

public Map<String,Object> getContextData()
Specified by:
getContextData in interface javax.ejb.EJBContext

getEJBHome

public javax.ejb.EJBHome getEJBHome()
Specified by:
getEJBHome in interface javax.ejb.EJBContext

getEJBLocalHome

public javax.ejb.EJBLocalHome getEJBLocalHome()
Specified by:
getEJBLocalHome in interface javax.ejb.EJBContext

getCallerPrincipal

public Principal getCallerPrincipal()
Specified by:
getCallerPrincipal in interface javax.ejb.EJBContext

getCallerPrincipal

protected Principal getCallerPrincipal(SecurityService securityService)

isCallerInRole

public boolean isCallerInRole(String s)
Specified by:
isCallerInRole in interface javax.ejb.EJBContext

isCallerInRole

protected boolean isCallerInRole(SecurityService securityService,
                                 String roleName)

getUserTransaction

public UserTransaction getUserTransaction()
                                   throws IllegalStateException
Specified by:
getUserTransaction in interface javax.ejb.EJBContext
Throws:
IllegalStateException

getUserTransaction

public UserTransaction getUserTransaction(UserTransaction userTransaction)
                                   throws IllegalStateException
Throws:
IllegalStateException

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException
Specified by:
setRollbackOnly in interface javax.ejb.EJBContext
Throws:
IllegalStateException

getRollbackOnly

public boolean getRollbackOnly()
                        throws IllegalStateException
Specified by:
getRollbackOnly in interface javax.ejb.EJBContext
Throws:
IllegalStateException

getTimerService

public javax.ejb.TimerService getTimerService()
                                       throws IllegalStateException
Specified by:
getTimerService in interface javax.ejb.EJBContext
Throws:
IllegalStateException

isTimerMethodAllowed

public boolean isTimerMethodAllowed()

isUserTransactionAccessAllowed

public boolean isUserTransactionAccessAllowed()

getEnvironment

public final Properties getEnvironment()
Specified by:
getEnvironment in interface javax.ejb.EJBContext

getCallerIdentity

public final Identity getCallerIdentity()
Specified by:
getCallerIdentity in interface javax.ejb.EJBContext

isCallerInRole

public final boolean isCallerInRole(Identity identity)
Specified by:
isCallerInRole in interface javax.ejb.EJBContext

lookup

public Object lookup(String name)
Specified by:
lookup in interface javax.ejb.EJBContext

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.