|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jonas_ejb.container.JMessageDrivenBean
public class JMessageDrivenBean
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
Field Summary | |
---|---|
protected JMdbFactory |
bf
|
protected MessageDrivenBean |
mdb
|
protected Session |
sess
|
protected int |
timerTxAttr
Transactional attribute for ejbTimeout method. |
protected org.objectweb.transaction.jta.TransactionManager |
tm
|
protected int |
txattr
Transactional attribute for onMessage method. |
protected WorkManager |
wm
|
Constructor Summary | |
---|---|
JMessageDrivenBean(JMdbFactory bf,
Session sess,
MessageDrivenBean mdb,
WorkManager wm)
constructor |
Method Summary | |
---|---|
void |
deliverTimeout(Timer timer)
Deliver a timeout to the bean |
Identity |
getCallerIdentity()
Deprecated. @exception java.lang.IllegalStateException always |
Principal |
getCallerPrincipal()
Obtain the java.security.Principal that identifies the caller. |
EJBHome |
getEJBHome()
Is disallowed. |
EJBLocalHome |
getEJBLocalHome()
Is disallowed. |
Properties |
getEnvironment()
Deprecated. Use the JNDI naming context java:comp/env instead. |
boolean |
getRollbackOnly()
Tests if the transaction has been marked for rollback only. |
Session |
getSession()
Return the ServerSession's Session. |
TimerService |
getTimerService()
Get access to the EJB Timer Service. |
UserTransaction |
getUserTransaction()
Obtains the transaction demarcation interface. |
boolean |
isCallerInRole(Identity role)
Deprecated. @throws java.lang.IllegalStateException for message driven bean because there is no security context available |
boolean |
isCallerInRole(String roleLink)
Test if the caller has a given role. |
Object |
lookup(String name)
Lookup object with given name. |
void |
onMessage(Message message)
A message has been received by the Session. |
void |
release()
|
void |
run()
Process messages by calling run method on Session. |
void |
setRollbackOnly()
Marks the current transaction for rollback. |
void |
start()
Cause the session's run method to be called to process messages that were just assigned to it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Session sess
protected JMdbFactory bf
protected MessageDrivenBean mdb
protected int txattr
protected int timerTxAttr
protected org.objectweb.transaction.jta.TransactionManager tm
protected WorkManager wm
Constructor Detail |
---|
public JMessageDrivenBean(JMdbFactory bf, Session sess, MessageDrivenBean mdb, WorkManager wm)
bf
- The MDB Factorysess
- The JMS Sessionmdb
- The Message Driven Beanwm
- The Work ManagerMethod Detail |
---|
public TimerService getTimerService() throws IllegalStateException
getTimerService
in interface EJBContext
IllegalStateException
- Thrown if the instance is not allowed to
use this methodpublic void onMessage(Message message)
onMessage
in interface MessageListener
message
- The received message to handle.public Session getSession() throws JMSException
getSession
in interface ServerSession
JMSException
- - if a JMS fails to get associated session for
this serverSession due to some internal error.public void start() throws JMSException
start
in interface ServerSession
JMSException
- - if a JMS fails to start the server session to
process messages.public void run()
run
in interface Runnable
public void release()
release
in interface Work
public Identity getCallerIdentity()
getCallerIdentity
in interface EJBContext
public Principal getCallerPrincipal()
getCallerPrincipal
in interface EJBContext
IllegalStateException
- alwayspublic boolean isCallerInRole(Identity role)
isCallerInRole
in interface EJBContext
public boolean isCallerInRole(String roleLink)
isCallerInRole
in interface EJBContext
IllegalStateException
- for message driven bean because
there is no security context availablepublic void setRollbackOnly()
setRollbackOnly
in interface EJBContext
IllegalStateException
- if the instance is not associated
with a transactionpublic boolean getRollbackOnly()
getRollbackOnly
in interface EJBContext
public EJBHome getEJBHome()
getEJBHome
in interface EJBContext
IllegalStateException
- Always.public EJBLocalHome getEJBLocalHome()
getEJBLocalHome
in interface EJBContext
IllegalStateException
- Always.public Properties getEnvironment()
getEnvironment
in interface EJBContext
public UserTransaction getUserTransaction() throws IllegalStateException
getUserTransaction
in interface EJBContext
IllegalStateException
- Thrown if the instance container does
not make the UserTransaction interface available to the
instance.public void deliverTimeout(Timer timer)
timer
- timer whose expiration caused this notification.public Object lookup(String name)
lookup
in interface EJBContext
name
- given name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |