com.caucho.ejb.server
Class AbstractContext<X>

java.lang.Object
  extended by com.caucho.ejb.server.AbstractContext<X>
All Implemented Interfaces:
EJBContext
Direct Known Subclasses:
AbstractSessionContext, MessageDrivenContextImpl

public abstract class AbstractContext<X>
extends java.lang.Object
implements EJBContext

Base class for an abstract context


Constructor Summary
AbstractContext()
           
 
Method Summary
 void __caucho_setInvokedBusinessInterface(java.lang.Class<?> invokedBusinessInterface)
           
 void __caucho_timeout_callback(java.lang.reflect.Method method)
          Runs the timeout callbacks
 void __caucho_timeout_callback(java.lang.reflect.Method method, Timer timer)
          Runs the timeout callbacks.
 void __caucho_timeout_callback(Timer timer)
          Runs the timeout callbacks.
 void destroy()
          Destroy the context.
 java.security.Identity getCallerIdentity()
          Obsolete method returns null.
 java.security.Principal getCallerPrincipal()
          Returns the principal
 java.util.Map<java.lang.String,java.lang.Object> getContextData()
           
 EJBHome getEJBHome()
          Returns the EJBHome stub for the container.
 EJBLocalHome getEJBLocalHome()
          Returns the EJBLocalHome stub for the container.
 EJBMetaData getEJBMetaData()
          Returns the EJB's meta data.
 java.util.Properties getEnvironment()
          Obsolete method which returns the EJB 1.0 environment.
 java.lang.Class<?> getInvokedBusinessInterface()
           
 boolean getRollbackOnly()
          Returns true if the current transaction will rollback.
abstract  AbstractEjbBeanManager<X> getServer()
          Returns the server which owns this bean.
 TimerService getTimerService()
          Looks the timer service.
 UserTransaction getUserTransaction()
          Returns the current UserTransaction.
 boolean isCallerInRole(java.security.Identity role)
          Obsolete method returns false.
 boolean isCallerInRole(java.lang.String roleName)
          Returns true if the caller is in the named role.
 boolean isDead()
          Returns true if the context is dead.
 java.lang.Object lookup(java.lang.String name)
          Looks up an object in the current JNDI context.
 void setDeclaredRoles(java.lang.String[] roles)
           
 void setRollbackOnly()
          Forces a rollback of the current transaction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContext

public AbstractContext()
Method Detail

setDeclaredRoles

public void setDeclaredRoles(java.lang.String[] roles)

isDead

public boolean isDead()
Returns true if the context is dead.


getServer

public abstract AbstractEjbBeanManager<X> getServer()
Returns the server which owns this bean.


getEJBMetaData

public EJBMetaData getEJBMetaData()
Returns the EJB's meta data.


getEJBHome

public EJBHome getEJBHome()
Returns the EJBHome stub for the container.

Specified by:
getEJBHome in interface EJBContext

getEJBLocalHome

public EJBLocalHome getEJBLocalHome()
Returns the EJBLocalHome stub for the container.

Specified by:
getEJBLocalHome in interface EJBContext

lookup

public java.lang.Object lookup(java.lang.String name)
Looks up an object in the current JNDI context.

Specified by:
lookup in interface EJBContext

getEnvironment

public java.util.Properties getEnvironment()
Obsolete method which returns the EJB 1.0 environment.

Specified by:
getEnvironment in interface EJBContext

getContextData

public final java.util.Map<java.lang.String,java.lang.Object> getContextData()
Specified by:
getContextData in interface EJBContext

getCallerIdentity

public java.security.Identity getCallerIdentity()
Obsolete method returns null.

Specified by:
getCallerIdentity in interface EJBContext

getCallerPrincipal

public java.security.Principal getCallerPrincipal()
Returns the principal

Specified by:
getCallerPrincipal in interface EJBContext

isCallerInRole

public boolean isCallerInRole(java.security.Identity role)
Obsolete method returns false.

Specified by:
isCallerInRole in interface EJBContext

isCallerInRole

public boolean isCallerInRole(java.lang.String roleName)
Returns true if the caller is in the named role.

Specified by:
isCallerInRole in interface EJBContext

getUserTransaction

public UserTransaction getUserTransaction()
                                   throws java.lang.IllegalStateException
Returns the current UserTransaction. Only Session beans with bean-managed transactions may use this.

Specified by:
getUserTransaction in interface EJBContext
Throws:
java.lang.IllegalStateException

getTimerService

public TimerService getTimerService()
                             throws java.lang.IllegalStateException
Looks the timer service.

Specified by:
getTimerService in interface EJBContext
Throws:
java.lang.IllegalStateException

setRollbackOnly

public void setRollbackOnly()
                     throws java.lang.IllegalStateException
Forces a rollback of the current transaction.

Specified by:
setRollbackOnly in interface EJBContext
Throws:
java.lang.IllegalStateException

getRollbackOnly

public boolean getRollbackOnly()
                        throws java.lang.IllegalStateException
Returns true if the current transaction will rollback.

Specified by:
getRollbackOnly in interface EJBContext
Throws:
java.lang.IllegalStateException

destroy

public void destroy()
             throws java.lang.Exception
Destroy the context.

Throws:
java.lang.Exception

getInvokedBusinessInterface

public java.lang.Class<?> getInvokedBusinessInterface()
                                               throws java.lang.IllegalStateException
Throws:
java.lang.IllegalStateException

__caucho_setInvokedBusinessInterface

public void __caucho_setInvokedBusinessInterface(java.lang.Class<?> invokedBusinessInterface)

__caucho_timeout_callback

public void __caucho_timeout_callback(Timer timer)
Runs the timeout callbacks.


__caucho_timeout_callback

public void __caucho_timeout_callback(java.lang.reflect.Method method)
                               throws java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException
Runs the timeout callbacks

Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

__caucho_timeout_callback

public void __caucho_timeout_callback(java.lang.reflect.Method method,
                                      Timer timer)
                               throws java.lang.IllegalAccessException,
                                      java.lang.reflect.InvocationTargetException
Runs the timeout callbacks.

Throws:
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException