| |
|
| java.lang.Object org.objectweb.jonas_ejb.container.JMessageDrivenBean
JMessageDrivenBean | public class JMessageDrivenBean implements MessageListener,ServerSession,Work,MessageDrivenContext(Code) | | 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 author: Christophe Ney (Easier Enhydra integration) |
Field Summary | |
protected JMdbFactory | bf | protected MessageDrivenBean | mdb | protected Session | sess | protected int | timerTxAttr Transactional attribute for ejbTimeout method. | protected TransactionManager | tm | protected int | txattr Transactional attribute for onMessage method. | protected WorkManager | wm |
mdb | protected MessageDrivenBean mdb(Code) | | |
sess | protected Session sess(Code) | | |
timerTxAttr | protected int timerTxAttr(Code) | | Transactional attribute for ejbTimeout method.
default is TX_REQUIRES_NEW
|
tm | protected TransactionManager tm(Code) | | |
txattr | protected int txattr(Code) | | Transactional attribute for onMessage method.
TX_NOT_SUPPORTED, TX_REQUIRED or TX_NOT_SET (= bean managed)
|
wm | protected WorkManager wm(Code) | | |
JMessageDrivenBean | public JMessageDrivenBean(JMdbFactory bf, Session sess, MessageDrivenBean mdb, WorkManager wm)(Code) | | constructor
Parameters: bf - The MDB Factory Parameters: sess - The JMS Session Parameters: mdb - The Message Driven Bean Parameters: wm - The Work Manager |
deliverTimeout | public void deliverTimeout(Timer timer)(Code) | | Deliver a timeout to the bean
Parameters: timer - timer whose expiration caused this notification. |
getCallerIdentity | public Identity getCallerIdentity()(Code) | | Obtains the java.security.Identity of the caller. disallowed in
messagedriven bean method because there is no security context
|
getCallerPrincipal | public Principal getCallerPrincipal()(Code) | | 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)
exception: java.lang.IllegalStateException - always |
getEJBHome | public EJBHome getEJBHome()(Code) | | Is disallowed. There is no home for message driven bean.
throws: IllegalStateException - Always. |
getEJBLocalHome | public EJBLocalHome getEJBLocalHome()(Code) | | Is disallowed. There is no local home for message driven bean.
throws: IllegalStateException - Always. |
getRollbackOnly | public boolean getRollbackOnly()(Code) | | Tests if the transaction has been marked for rollback only.
True if transaction has been marked for rollback. |
getSession | public Session getSession() throws JMSException(Code) | | 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.
the server session's session. exception: JMSException - - if a JMS fails to get associated session forthis serverSession due to some internal error. |
getUserTransaction | public UserTransaction getUserTransaction() throws IllegalStateException(Code) | | Obtains the transaction demarcation interface.
The UserTransaction interface that the enterprise bean instancecan use for transaction demarcation. exception: IllegalStateException - : Thrown if the instance container doesnot make the UserTransaction interface available to theinstance. |
isCallerInRole | public boolean isCallerInRole(Identity role)(Code) | | Test if the caller has a given role.
|
onMessage | public synchronized void onMessage(Message message)(Code) | | 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. |
release | public void release()(Code) | | |
run | public void run()(Code) | | Process messages by calling run method on Session. When finished, return
the object in the pool.
|
setRollbackOnly | public void setRollbackOnly()(Code) | | Marks the current transaction for rollback. Should be used only if the
instance is associated with a transaction
throws: java.lang.IllegalStateException - if the instance is not associatedwith a transaction |
start | public void start() throws JMSException(Code) | | Cause the session's run method to be called to process messages that were
just assigned to it.
exception: JMSException - - if a JMS fails to start the server session toprocess messages. |
|
|
|