• 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

Container callback restrictions...

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

The spec says that in ejbCreate, ejbRemove, ejbActivate and ejbPassivate you can call from the SessionContext the isCallerInRole and getCallerPrincipal but with ejbActivate and ejbPassivate there is no direct caller.

Is this right that calls to isCallerInRole and getCallerPrincipal are allowed in ejbActivate and ejbPassivate?

The spec says so, so it must be, but there is no caller for these methods.

Thanx for any help...

James.
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi James,

As per spec:


Invoking the getCallerPrincipal and isCallerInRole methods is disallowed in
the session bean methods for which the Container does not have a client security context.



For a SFSB instance there is a client security context when Container executes ejbActivate/ejbPassivate as stateful session bean is always associated with a particular client since its creation (i.e. since an instance of the bean has been created with the call to ejbCreate method)

Therefore, one can invoke security related methods on SessionContext when Container passivates/activates an instance of SFSB.

 
James Turner
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Alex,

Thank you for your reply, I thought the client security context, like a transaction context was propagated as per call.

Thanx for your help.

James.
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic