• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Operations Allowed in the Methods of a MDB

 
Ranch Hand
Posts: 389
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic