This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

get security info about the client

 
Yi Zou
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all,
In First Head EJB book, it says you can get client security info in ebjCreate, ejbRemove, ejbPassivate and ejbActivate.
But in EJB spec page 90, the chart there shows you can only do this
business method.
(Unless, there is other ways to get security info instead of isCallerinRole
etc)
Anyone has any idea?
Thanks
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remember, different bean types have different lifecycles -- so while some allow you to get that information, others will throw a nasty exception (depending on when the time).
 
Vagner Freitas
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yi,

Stateless session beans can get client security info only in business methods.
Stateful session beans can get client security info in ejbCreate, ejbRemove, ejbActivate, ejbPassivate and business methods.
CMP entity beans can get client security info in ejbCreate, ejbPostCreate, ejbRemove, ejbLoad, ejbStore and home business methods.

I hope this helps you.

Vagner
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic