org.objectweb.jonas_ejb.container
Class JStatelessContext

java.lang.Object
  extended by org.objectweb.jonas_ejb.container.JContext
      extended by org.objectweb.jonas_ejb.container.JSessionContext
          extended by org.objectweb.jonas_ejb.container.JStatelessContext
All Implemented Interfaces:
java.io.Serializable, javax.ejb.EJBContext, javax.ejb.SessionContext, javax.ejb.TimerService

public class JStatelessContext
extends JSessionContext
implements javax.ejb.TimerService

This class extends JSessionContext in case of Stateless Session Bean.

Author:
Philippe Durieux
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jonas_ejb.container.JSessionContext
bs, ismarkedremoved
 
Fields inherited from class org.objectweb.jonas_ejb.container.JContext
bf, myinstance, tm
 
Constructor Summary
JStatelessContext(JSessionFactory bf, javax.ejb.SessionBean sb)
          constructor
 
Method Summary
 javax.ejb.Timer createTimer(java.util.Date arg0, long arg1, java.io.Serializable arg2)
           
 javax.ejb.Timer createTimer(java.util.Date arg0, java.io.Serializable arg1)
           
 javax.ejb.Timer createTimer(long arg0, long arg1, java.io.Serializable arg2)
           
 javax.ejb.Timer createTimer(long arg0, java.io.Serializable arg1)
           
 java.security.Principal getCallerPrincipal()
          Obtain the java.security.Principal that identifies the caller.
 javax.xml.rpc.handler.MessageContext getMessageContext()
          Obtain a reference to the JAX-RPC MessageContext.
 java.util.Collection getTimers()
           
 javax.ejb.TimerService getTimerService()
          Get access to the EJB Timer Service.
 boolean isCallerInRole(java.lang.String roleName)
          Test if the caller has a given role.
 void setConnectionList(java.util.List conlist)
          Set the connection list for this instance.
 void setRemoved()
          set this instance as removed
 
Methods inherited from class org.objectweb.jonas_ejb.container.JSessionContext
getEJBLocalObject, getEJBObject, getInstance, getRollbackOnly, initSessionContext, isMarkedRemoved
 
Methods inherited from class org.objectweb.jonas_ejb.container.JContext
getCallerIdentity, getEJBHome, getEJBLocalHome, getEnvironment, getState, getUserTransaction, getWorkManager, isCallerInRole, setRollbackOnly, setState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.ejb.EJBContext
getCallerIdentity, getEJBHome, getEJBLocalHome, getEnvironment, getUserTransaction, isCallerInRole, setRollbackOnly
 

Constructor Detail

JStatelessContext

public JStatelessContext(JSessionFactory bf,
                         javax.ejb.SessionBean sb)
constructor

Parameters:
bf - The Bean Factory
sb - The Session Bean instance.
Method Detail

getTimerService

public javax.ejb.TimerService getTimerService()
                                       throws java.lang.IllegalStateException
Get access to the EJB Timer Service.

Specified by:
getTimerService in interface javax.ejb.EJBContext
Specified by:
getTimerService in class JContext
Returns:
the EJB Timer Service
Throws:
java.lang.IllegalStateException - Thrown if the instance is not allowed to use this method

setRemoved

public void setRemoved()
                throws java.rmi.RemoteException,
                       javax.ejb.RemoveException
set this instance as removed

Specified by:
setRemoved in class JSessionContext
Throws:
java.rmi.RemoteException
javax.ejb.RemoveException

getMessageContext

public javax.xml.rpc.handler.MessageContext getMessageContext()
                                                       throws java.lang.IllegalStateException
Obtain a reference to the JAX-RPC MessageContext.

Specified by:
getMessageContext in interface javax.ejb.SessionContext
Specified by:
getMessageContext in class JSessionContext
Returns:
The MessageContext for this web service invocation.
Throws:
java.lang.IllegalStateException - - the instance is in a state that does not allow access to this method.

setConnectionList

public void setConnectionList(java.util.List conlist)
Set the connection list for this instance.

Specified by:
setConnectionList in class JSessionContext

getCallerPrincipal

public java.security.Principal getCallerPrincipal()
                                           throws java.lang.IllegalStateException
Obtain the java.security.Principal that identifies the caller. throws a java.lang.IllegalStateException if there is no security context available

Specified by:
getCallerPrincipal in interface javax.ejb.EJBContext
Overrides:
getCallerPrincipal in class JContext
Returns:
The Principal object that identifies the caller.
Throws:
java.lang.IllegalStateException - no security context exists

isCallerInRole

public boolean isCallerInRole(java.lang.String roleName)
                       throws java.lang.IllegalStateException
Test if the caller has a given role.

Specified by:
isCallerInRole in interface javax.ejb.EJBContext
Overrides:
isCallerInRole in class JContext
Parameters:
roleName - The name of the security role. The role must be one of the security-role-ref that is defined in the deployment descriptor.
Returns:
True if the caller has the specified role.
Throws:
java.lang.IllegalStateException - Security service not started

createTimer

public javax.ejb.Timer createTimer(long arg0,
                                   java.io.Serializable arg1)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IllegalStateException,
                                   javax.ejb.EJBException
Specified by:
createTimer in interface javax.ejb.TimerService
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
javax.ejb.EJBException
See Also:
TimerService.createTimer(long, java.io.Serializable)

createTimer

public javax.ejb.Timer createTimer(long arg0,
                                   long arg1,
                                   java.io.Serializable arg2)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IllegalStateException,
                                   javax.ejb.EJBException
Specified by:
createTimer in interface javax.ejb.TimerService
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
javax.ejb.EJBException
See Also:
TimerService.createTimer(long, long, java.io.Serializable)

createTimer

public javax.ejb.Timer createTimer(java.util.Date arg0,
                                   java.io.Serializable arg1)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IllegalStateException,
                                   javax.ejb.EJBException
Specified by:
createTimer in interface javax.ejb.TimerService
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
javax.ejb.EJBException
See Also:
TimerService.createTimer(java.util.Date, java.io.Serializable)

createTimer

public javax.ejb.Timer createTimer(java.util.Date arg0,
                                   long arg1,
                                   java.io.Serializable arg2)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.IllegalStateException,
                                   javax.ejb.EJBException
Specified by:
createTimer in interface javax.ejb.TimerService
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalStateException
javax.ejb.EJBException
See Also:
TimerService.createTimer(java.util.Date, long, java.io.Serializable)

getTimers

public java.util.Collection getTimers()
                               throws java.lang.IllegalStateException,
                                      javax.ejb.EJBException
Specified by:
getTimers in interface javax.ejb.TimerService
Throws:
java.lang.IllegalStateException
javax.ejb.EJBException
See Also:
TimerService.getTimers()