Forums Register Login

EJB 3.0 -Superclass&Method Permission

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
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
You save more money with a clothesline than dozens of light bulb purchases. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 520 times.
Similar Threads
My SCEA Part 1Study Notes
question about Transaction atrribute
Need Help with Concepts of Security Management
similarity between ejb 2.0 and ejb 3.0
EJB Notes I prepared during my preparation for SCBCD
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 06:12:54.