• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

StatefulSessionBean - regarding

 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to spec. Page 80, from with setSessionContext() method of a stateful session bean, we cannot call getCallerPrincipal() method.

For a stateful session EJB, when the setSessionContext method is run , there must have been a user who had called create which starts off the instantiation process � new instance, setSessionContext, ejbCreate. At this time why isn�t the sessionContext able to call getCallerPrincipal, isCallerInRole() methods?

Also, what happens between setSessionContext and ejbCreate methods such that in the latter we are able to call getCallerPrincipal() method?(spec. Page 80)
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The purpose of setSessionContext is just to enable the storage of the reference to the SessionContext in an instance variable.

It is in ejbCreate where you can really start doing things as the object has been changed to an EJB. This is why client security information becomes available for the first time.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But Roger, In setSessionContext(), we have the context instance available which is the lifeline to the container....so i don't quite understand why the client security info shudn't be avaliable out in the setSessionContext()methd.
pls advice.

thanks
 
Replace the word "snake" with "danger noodle" in all tiny ads.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic