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

EJB 3.0 -Superclass&Method Permission

 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From core specs EJB 3.0 page 466. (Chapter: Security Mgmt)

If the bean class has superclasses, the following additional rules apply.

(1) � A method permissions value specified on a superclass S applies to the business methods defined by S.

(2) � A method permissions value may be specified on a business method M defined by class S to override for method M the method permissions value explicitly or implicitly specified on the class S.

(3)� If a method M of class S overrides a business method defined by a superclass of S, the method permissions value of M is determined by the above rules as applied to class S.

Can anyone explain point 2 ?. I do understand from 2&3 that if in the child class the security for method has been overridden then the child class methods security configuration would be considered. This is explained by point 3 - but what of point 2?

Thanks!
Shivani
 
Senthil Kumar
Ranch Hand
Posts: 264
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shivani,
I guess this is what the mean by the 2nd point.

Class S has a method M. If both the class and the method are annotated with the method permissions, then the annotation applied on the method M will take precedence over the annotation applied on the class S.
I have seen many places in the spec that they have complicated the things to apprehend where it has to be in simpler terms.
 
Shivani Chandna
Ranch Hand
Posts: 380
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Senthil,

Yes a similar example is used in the chapter on Transaction. Somehow I understood it correctly from that chapter.

You have correctly explained for it.

1. means class level applies to all methods
2. means that method overrides class level
3. for child class and superclass the above 2 rules hold true.

thanks!
Shivani
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic