Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

getCallerPrincipal() in onMessage()

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On table 12 p344 of the EJB spec, it states that getCallerPrincipal() as one of the methods that can be called within a message listener method (i.e. onMessage()). Does anyone know why it is legal to call getCallerPrincipal, when there is no 'direct' caller for a message driven bean?
 
Kelly Wood
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to the notes here: http://www.java.boot.by/bcd-guide/ch10.html#c10s1

"Invoking the getCallerPrincipal() and isCallerInRole(...) methods is DISALLOWED in the message-driven bean methods because the Container DOES NOT HAVE a client security context. The Container MUST throw and log the java.lang.IllegalStateException if either of these methods is invoked."

The above explanation makes sense to me. I am confused as to why the EJB spec states 'getCallerPrincipal()' as one of the methods allowed to be called. I will assume it is an error on the EJB spec. But can someone confirm?
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends,

Please read again the text,

the getCallerPrincipal and isCallerInRole methods are not in the table,

and the specification say that the methods are disallowed to call...

the page is 320.

[ ]s

Gustavo
 
    Bookmark Topic Watch Topic
  • New Topic