I guess Treimin hits the mark:
The expected around-invoke method signature including return type and throws clause is fixed.
That means, any method overloading a specified around-invoke method (e.g. by specifiying different parameter types in the method signature) shoud be ignored by the
EJB container, at least.
While overloaded around-invoke methods seem to be legal concering the specs, the ejb-jar_3_0.xsd scheme comments they are not:
ejb-jar_3_0.xsd:
...
<xsd:complexType name="around-invokeType">
<xsd:annotation>
<xsd:documentation>
The around-invoke type specifies a method on a
class to be called during the around invoke portion of an
ejb invocation. Note that each class may have only one
around invoke method and that the method may not be
overloaded.
...
So the EJB container might complain about overloaded around-invoke methods.
But overriding is funny enough. I just wonder about this scenario:
Now, I inject MySpecialInterceptor into an arbitrary busines method. Which around-invoke method body is executed?
Due to "base class first" + "override overrides" ;-) ... I'd assume:
So I actually defined two around-invoke methods in one interceptor class?!