Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

client security context

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks (although Roger seems the only one out there!),

Why is it that one cannot obtain client security information in the ejbActivate and ejbPassivate methods of an entity bean? (Page 354 HFEJB).
In fact, the whole issue of the client context is a little baffling. I thought a bean had access to the client context at or after the point at which the bean and the EJBObject are linked. Is this right?

AN activation request comes in response to a business method call from the client, so I would have thought one could obtain client security information in the entity bean ejbActivate/ejbPassivate methods. Clearly I am wrong, but why?

regards,
Simon
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still only me out here

A bean's method can only get client security information if there is a client. This is why it is possible from the ejbCreate() and ejbRemove() methods of a stateful session bean and an entity bean but not of a stateless session bean.

As for the ejbActivate() and ejbPassivate() methods of an entity bean ... When ejbActivate() is run, it is still not ready to deal with a business method, ejbLoad() must then be invoked. So, you can therefore get client security information from ejbLoad().

When ejbPassivate() is run, ejbStore() will already have been run. You can get client security information from ejbStore(). ejbPassivate() is really about transitioning the bean from the ready to the pooled state, and at this point in the life cycle it has no client.

I'm ready to be corrected on this ...
 
Simon Ingram
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Roger. Your explanation makes good sense.
 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Excellent explanation, Roger!!! I've just read it and recalled my brain about it...

BTW, when will u take the exam? Mine on 30th May...
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exam date 1 June, should be enough time
 
You're not going crazy. You're going sane in a crazy word. Find comfort in this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic