Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Operations Allowed in the Methods of a MDB

 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Is invoking getEJBObject or getEJBLocalObject allowed in message-driven bean methods?

I looked at the EJB specifications and it doesn't mention this although it does mention that "Invoking getEJBHome or getEJBLocalHome is disallowed in message-driven bean methods".

Thanks

-- Ravi
 
Daniel Rhoades
Ranch Hand
Posts: 186
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you talk to MDB through the JMS, you never get a reference to a bean or an EJBObject.

So MDB don't have homes, infact you don't even write a home or component interface, only the bean class
 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

So what happens if getEJBObject or getEJBLocalObject is invoked in message-driven bean methods. Does it throw java.lang.IllegalStateException?

Thanks

-- Ravi
[ March 25, 2005: Message edited by: Ravindra Janapareddy ]
 
amol deshpande
Ranch Hand
Posts: 162
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right ravi,
Its java.lang.IllegalStateException....will kill bean, Tx rollback and log it.(i mean bean instance....i know u know..but..)
amol.
 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

EntityContext provides getEJBObject, getEJBLocalObject and getPrimaryKey methods apart from the methods inhertited from EJBContext.

SessionContext provides getEJBObject and getEJBLocalObject methods apart from the methods inhertited from EJBContext.

Whereas MessageDrivenContext doesn't provide any methods apart from the methods inhertited from EJBContext.

That explains the answer.

Thanks

-- Ravi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic