• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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
 
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic