Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get EntityContext object reference in Business methods

 
mohan dodderi
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am Mohandodderi , i have a dought that how to get EntityContext object reference in our business method and i want to use this to call

getCallerPrincipal();
isCallerInRole()

methods , if any one know how to invoke theese method pls inform me


Thanks and regards
Mohandodderi
 
Sue Pillai
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mohan dodderi:
hi i am Mohandodderi , i have a dought that how to get EntityContext object reference in our business method and i want to use this to call

getCallerPrincipal();
isCallerInRole()

methods , if any one know how to invoke theese method pls inform me


Thanks and regards
Mohandodderi


Can you not set and get the entitycontext in you bean and use the reference to call the methods, as in ctx.isCallerInRole()?
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Container calls the setEntityContext(EntityContext ctx) method on the bean instance when the container adds the new instance to the pool. In the bean class you can implement this method and set the EntityContext instance passed by container into a instance variable of the bean class.

Later on the EntityContext instance can be used from the other business methods to get the caller's security info etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic