org.objectweb.jonas_ejb.container.JMessageDrivenBean Class Reference

Collaboration diagram for org.objectweb.jonas_ejb.container.JMessageDrivenBean:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 JMessageDrivenBean (JMdbFactory bf, Session sess, MessageDrivenBean mdb, ThreadPool thpool)
TimerService getTimerService () throws IllegalStateException
synchronized void onMessage (Message message)
Session getSession () throws JMSException
void start () throws JMSException
void run ()
Identity getCallerIdentity ()
Principal getCallerPrincipal ()
boolean isCallerInRole (Identity role)
boolean isCallerInRole (java.lang.String roleLink)
void setRollbackOnly ()
boolean getRollbackOnly ()
EJBHome getEJBHome ()
EJBLocalHome getEJBLocalHome ()
Properties getEnvironment ()
UserTransaction getUserTransaction () throws IllegalStateException
void deliverTimeout (Timer timer)

Protected Attributes

int txattr
int timerTxAttr

Detailed Description

Generic interposed class for Message Driven Beans This class presents these interfaces, depending on object reached: ServerSession interface to the ServerSessionPool MessageDrivenContext interface to the bean instance MessageListener interface to the JMS Session Runnable interface to the ThreadPool
Author:
Philippe Coq, Philippe Durieux

Christophe Ney (Easier Enhydra integration)

Definition at line 65 of file JMessageDrivenBean.java.


Constructor & Destructor Documentation

org.objectweb.jonas_ejb.container.JMessageDrivenBean.JMessageDrivenBean JMdbFactory  bf,
Session  sess,
MessageDrivenBean  mdb,
ThreadPool  thpool
 

constructor

Parameters:
bf The MDB Factory
sess The JMS Session
mdb The Message Driven Bean
thpool The Thread Pool

Definition at line 96 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JFactory.getTimerTxAttribute(), org.objectweb.jonas_ejb.container.JMdbFactory.getTransactionAttribute(), org.objectweb.jonas_ejb.container.JFactory.getTransactionManager(), org.objectweb.jonas_ejb.container.JMessageDrivenBean.timerTxAttr, and org.objectweb.jonas_ejb.container.JMessageDrivenBean.txattr.

Here is the call graph for this function:


Member Function Documentation

void org.objectweb.jonas_ejb.container.JMessageDrivenBean.deliverTimeout Timer  timer  ) 
 

Deliver a timeout to the bean

Parameters:
timer timer whose expiration caused this notification.

Definition at line 375 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JFactory.checkSecurity(), org.objectweb.jonas_ejb.container.JFactory.postInvoke(), org.objectweb.jonas_ejb.container.JFactory.preInvoke(), org.objectweb.jonas_ejb.container.RequestCtx.sysExc, and org.objectweb.jonas_ejb.container.JMessageDrivenBean.timerTxAttr.

Referenced by org.objectweb.jonas_ejb.container.JMdbFactory.notifyTimeout().

Here is the call graph for this function:

Identity org.objectweb.jonas_ejb.container.JMessageDrivenBean.getCallerIdentity  ) 
 

Obtains the java.security.Identity of the caller. disallowed in messagedriven bean method because there is no security context

Deprecated:
Exceptions:
java.lang.IllegalStateException always

Definition at line 238 of file JMessageDrivenBean.java.

Principal org.objectweb.jonas_ejb.container.JMessageDrivenBean.getCallerPrincipal  ) 
 

Obtain the java.security.Principal that identifies the caller. throws a java.lang.IllegalStateException for message driven bean because there is no security context available (EJB v2.0, chapter 14.5.1)

Exceptions:
java.lang.IllegalStateException always

Definition at line 249 of file JMessageDrivenBean.java.

EJBHome org.objectweb.jonas_ejb.container.JMessageDrivenBean.getEJBHome  ) 
 

Is disallowed. There is no home for message driven bean.

Exceptions:
IllegalStateException Always.

Definition at line 326 of file JMessageDrivenBean.java.

EJBLocalHome org.objectweb.jonas_ejb.container.JMessageDrivenBean.getEJBLocalHome  ) 
 

Is disallowed. There is no local home for message driven bean.

Exceptions:
IllegalStateException Always.

Definition at line 335 of file JMessageDrivenBean.java.

Properties org.objectweb.jonas_ejb.container.JMessageDrivenBean.getEnvironment  ) 
 

Deprecated:
Use the JNDI naming context java:comp/env instead.
Returns:
properties for the bean.

Definition at line 344 of file JMessageDrivenBean.java.

boolean org.objectweb.jonas_ejb.container.JMessageDrivenBean.getRollbackOnly  ) 
 

Tests if the transaction has been marked for rollback only.

Returns:
True if transaction has been marked for rollback.

Definition at line 297 of file JMessageDrivenBean.java.

Session org.objectweb.jonas_ejb.container.JMessageDrivenBean.getSession  )  throws JMSException
 

Return the ServerSession's Session. This must be a Session created by the same Connection which will be dispatching messages to it. The provider will assign one or more messages to the Session and then call start on the ServerSession.

Returns:
the server session's session.
Exceptions:
JMSException - if a JMS fails to get associated session for this serverSession due to some internal error.

Definition at line 192 of file JMessageDrivenBean.java.

TimerService org.objectweb.jonas_ejb.container.JMessageDrivenBean.getTimerService  )  throws IllegalStateException
 

Get access to the EJB Timer Service.

Returns:
the EJB Timer Service
Exceptions:
IllegalStateException Thrown if the instance is not allowed to use this method

Definition at line 117 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JMdbFactory.getTimerService().

Here is the call graph for this function:

UserTransaction org.objectweb.jonas_ejb.container.JMessageDrivenBean.getUserTransaction  )  throws IllegalStateException
 

Obtains the transaction demarcation interface.

Returns:
The UserTransaction interface that the enterprise bean instance can use for transaction demarcation.
Exceptions:
IllegalStateException: Thrown if the instance container does not make the UserTransaction interface available to the instance.

Definition at line 357 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JFactory.isTxBeanManaged().

Here is the call graph for this function:

boolean org.objectweb.jonas_ejb.container.JMessageDrivenBean.isCallerInRole java.lang.String  roleLink  ) 
 

Test if the caller has a given role.

Exceptions:
java.lang.IllegalStateException for message driven bean because there is no security context available

Definition at line 269 of file JMessageDrivenBean.java.

boolean org.objectweb.jonas_ejb.container.JMessageDrivenBean.isCallerInRole Identity  role  ) 
 

Test if the caller has a given role.

Deprecated:
Exceptions:
java.lang.IllegalStateException for message driven bean because there is no security context available

Definition at line 259 of file JMessageDrivenBean.java.

synchronized void org.objectweb.jonas_ejb.container.JMessageDrivenBean.onMessage Message  message  ) 
 

A message has been received by the Session. Basically, we have to do: preInvoke + onMessage + postInvoke. No exception should be returned to the caller.

Parameters:
message The received message to handle.

Definition at line 132 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JFactory.checkSecurity(), org.objectweb.jonas_ejb.container.RequestCtx.currTx, org.objectweb.jonas_ejb.container.RequestCtx.mustCommit, org.objectweb.jonas_ejb.container.JFactory.postInvoke(), org.objectweb.jonas_ejb.container.JFactory.preInvoke(), org.objectweb.jonas_ejb.container.RequestCtx.sysExc, and org.objectweb.jonas_ejb.container.JMessageDrivenBean.txattr.

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JMessageDrivenBean.run  ) 
 

Process messages by calling run method on Session. When finished, return the object in the pool.

Definition at line 216 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.JFactory.myClassLoader(), and org.objectweb.jonas_ejb.container.JMdbFactory.releaseServerSession().

Here is the call graph for this function:

void org.objectweb.jonas_ejb.container.JMessageDrivenBean.setRollbackOnly  ) 
 

Marks the current transaction for rollback. Should be used only if the instance is associated with a transaction

Exceptions:
java.lang.IllegalStateException if the instance is not associated with a transaction

Definition at line 280 of file JMessageDrivenBean.java.

void org.objectweb.jonas_ejb.container.JMessageDrivenBean.start  )  throws JMSException
 

Cause the session's run method to be called to process messages that were just assigned to it.

Exceptions:
JMSException - if a JMS fails to start the server session to process messages.

Definition at line 203 of file JMessageDrivenBean.java.

References org.objectweb.jonas_ejb.container.ThreadPool.addRunnable().

Here is the call graph for this function:


Member Data Documentation

int org.objectweb.jonas_ejb.container.JMessageDrivenBean.timerTxAttr [protected]
 

Transactional attribute for ejbTimeout method. default is TX_REQUIRES_NEW

Definition at line 83 of file JMessageDrivenBean.java.

Referenced by org.objectweb.jonas_ejb.container.JMessageDrivenBean.deliverTimeout(), and org.objectweb.jonas_ejb.container.JMessageDrivenBean.JMessageDrivenBean().

int org.objectweb.jonas_ejb.container.JMessageDrivenBean.txattr [protected]
 

Transactional attribute for onMessage method. TX_NOT_SUPPORTED, TX_REQUIRED or TX_NOT_SET (= bean managed)

Definition at line 77 of file JMessageDrivenBean.java.

Referenced by org.objectweb.jonas_ejb.container.JMessageDrivenBean.JMessageDrivenBean(), and org.objectweb.jonas_ejb.container.JMessageDrivenBean.onMessage().


The documentation for this class was generated from the following file:
Generated on Tue Feb 15 15:10:30 2005 for JOnAS by  doxygen 1.3.9.1