org.ow2.jonas.lib.ejb21
Class JStatelessContext

java.lang.Object
  extended by org.ow2.jonas.lib.ejb21.JContext
      extended by org.ow2.jonas.lib.ejb21.JSessionContext
          extended by org.ow2.jonas.lib.ejb21.JStatelessContext
All Implemented Interfaces:
Serializable, EJBContext, SessionContext, TimerService

public class JStatelessContext
extends JSessionContext
implements 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.ow2.jonas.lib.ejb21.JSessionContext
bs, ismarkedremoved
 
Fields inherited from class org.ow2.jonas.lib.ejb21.JContext
bf, CTX_STATE_ACTIVE, CTX_STATE_COMMITTING, CTX_STATE_FINDING, CTX_STATE_INITIAL, CTX_STATE_PASSIVE, myinstance, tm
 
Constructor Summary
JStatelessContext(JSessionFactory bf, SessionBean sb)
          constructor
 
Method Summary
 Timer createTimer(Date arg0, long arg1, Serializable arg2)
           
 Timer createTimer(Date arg0, Serializable arg1)
           
 Timer createTimer(long arg0, long arg1, Serializable arg2)
           
 Timer createTimer(long arg0, Serializable arg1)
           
 Principal getCallerPrincipal()
          Obtain the java.security.Principal that identifies the caller.
 MessageContext getMessageContext()
          Obtain a reference to the JAX-RPC MessageContext.
 Collection getTimers()
           
 TimerService getTimerService()
          Get access to the EJB Timer Service.
 boolean isCallerInRole(String roleName)
          Test if the caller has a given role.
 void setConnectionList(List conlist)
          Set the connection list for this instance.
 void setRemoved()
          set this instance as removed
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JSessionContext
getBusinessObject, getEJBLocalObject, getEJBObject, getInstance, getInvokedBusinessInterface, getRollbackOnly, initSessionContext, isMarkedRemoved
 
Methods inherited from class org.ow2.jonas.lib.ejb21.JContext
getCallerIdentity, getEJBHome, getEJBLocalHome, getEnvironment, getState, getUserTransaction, getWorkManager, isCallerInRole, lookup, setActive, setCommitting, setFinding, setPassive, 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, lookup, setRollbackOnly
 

Constructor Detail

JStatelessContext

public JStatelessContext(JSessionFactory bf,
                         SessionBean sb)
constructor

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

getTimerService

public TimerService getTimerService()
                             throws IllegalStateException
Get access to the EJB Timer Service.

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

setRemoved

public void setRemoved()
                throws RemoteException,
                       RemoveException
set this instance as removed

Specified by:
setRemoved in class JSessionContext
Throws:
RemoteException
RemoveException

getMessageContext

public MessageContext getMessageContext()
                                 throws IllegalStateException
Obtain a reference to the JAX-RPC MessageContext.

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

setConnectionList

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

Specified by:
setConnectionList in class JSessionContext

getCallerPrincipal

public Principal getCallerPrincipal()
                             throws 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 EJBContext
Overrides:
getCallerPrincipal in class JContext
Returns:
The Principal object that identifies the caller.
Throws:
IllegalStateException - no security context exists

isCallerInRole

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

Specified by:
isCallerInRole in interface 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:
IllegalStateException - Security service not started

createTimer

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

createTimer

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

createTimer

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

createTimer

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

getTimers

public Collection getTimers()
                     throws IllegalStateException,
                            EJBException
Specified by:
getTimers in interface TimerService
Throws:
IllegalStateException
EJBException
See Also:
TimerService.getTimers()


Copyright © 2010 OW2 Consortium. All Rights Reserved.