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

Style 1 and Style 2 deployment descriptor method permissions

 
Charles O'Leary
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How can both Style 1 and Style 2 deployment descriptor method permission refer to ALL of the overloaded methods? In other words, when is it appropriate to ignore Style 3 method parameters?






How do the following Style 3 statements coexist?


This style is used to refer to a specified method within a set of methods with an overloaded
name. ... If there are multiple methods with the same overloaded
name, however, this style refers to all of the overloaded methods.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can both Style 1 and Style 2 deployment descriptor method permission refer to ALL of the overloaded methods?

By default they refer to all methods (style 1) of a bean,or to all methods with the same name (style 2). Style 3 will only be used if you want to do something specific for an overloaded method.

How do the following Style 3 statements coexist?

You mixed style 2 and style 3 statements:

Style 2:
If there are multiple methods with the same overloaded name, this style refers to all the methods with the same name.

Style 3:
This style is used to refer to a single method within a set of methods with an overloaded name.
 
Charles O'Leary
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had hoped that was going to be the reasoning (I was thinking the same). However, the spec does read:


Style 3:
<method>
<ejb-name>EJBNAME</ejb-name>
<method-name>METHOD</method-name>
<method-params>
<method-param>PARAMETER_1</method-param>
...
<method-param>PARAMETER_N</method-param>
</method-params>
</method>

This style is used to refer to a specified method within a set of methods with an overloaded
name. The method must be defined in the specified enterprise bean’s business, home, or component
interface, or web service endpoint. If there are multiple methods with the same overloaded
name, however, this style refers to all of the overloaded methods.



Please help me sort out the "a" versus the "all" within the same "Style 3" style. The "blah style" (pun completely intended) of the specification is a little confusing for me at times.

Does this mean that if this style is used in let's say both the enterprise bean’s business interface AND the enterprise bean’s web service endpoint, then this style refers to both (all in this case) the enterprise bean’s business interface AND the enterprise bean’s web service endpoint because they would both have a METHOD(PARAMETER_1, PARAMETER_2)? If there was only an enterprise bean’s business interface with METHOD(), METHOD(PARAMETER_1), and METHOD(PARAMETER_1, PARAMETER_2, PARAMETER_3, ..., PARAMETER_N), use of style three in just the enterprise bean’s business interface would NOT mean all versions of METHOD given the following

<method>
<ejb-name>EJBNAME</ejb-name>
<method-name>METHOD</method-name>
<method-params>
<method-param>PARAMETER_1</method-param>
...
<method-param>PARAMETER_2</method-param>
</method-params>
</method>

Correct?
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Charles,
I am not sure if I understand your question.



or


if we have this, the method permission applies for all doWork methods. For example, if the method permission is set for role "System Admin", then only "System Admin" can access to all
the doWork methods.


Do I answer your question?

 
Charles O'Leary
Ranch Hand
Posts: 54
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Himai,

That didn't quite clear it up for me. Thank you for trying. To help ME clear MY confusion, let's go with that however.


If

"a" // method permission applied to doWork(String param1, int param2)

***OR***

"a" //method permission applied to doWork(paramA, paramB, paramC)

then how come "System Admin" can access to "all"
["all" in my mind, equals to "a" doWork(String param1, int param2) ***AND*** "a" doWork(paramA, paramB, paramC), with a grand total of "ALL" the defined methods of ]
the doWork methods???

I clearly see how doWork without method parameters represents ALL doWork methods. MY failure is comprehending how "ALL" is applied to Style 3 as stated in the specification?


Frits:

Style 3:
This style is used to refer to a single method within a set of methods with an overloaded name.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me sort out the "a" versus the "all" within the same "Style 3" style. The "blah style" (pun completely intended) of the specification is a little confusing for me at times.

I see your point now, the wording is a bit odd.

Does this mean that if this style is used in let's say both the enterprise bean’s business interface AND the enterprise bean’s web service endpoint, then this style refers to both (all in this case) the enterprise bean’s business interface AND the enterprise bean’s web service endpoint because they would both have a METHOD(PARAMETER_1, PARAMETER_2)?

You are right here. If you then want to differentiate between the method permissions of the WebService endpoint and the Business interface you can use the optional <method-intf> element


The optional method-intf element can be used to differentiate between methods with the same name and signature that are multiply defined across the business, component, or home interfaces, no-interface view, and/or web service endpoint.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic