javaee / interceptors-spec

interceptors-spec~interceptors-spec-repository
Other
6 stars 3 forks source link

Fix or explain throws Exception clause in interceptor method signatures #8

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

WHAT's WRONG? The interceptors spec contradicts itself when describing an interceptor method exceptions rules and defining the interceptor method:

A. The Interceptors spec restrictions on exceptions that can be thrown by an interceptor method:

2.4Exceptions "Interceptor methods are allowed to throw runtime exceptions or any checked exceptions that the associated target method allows within its throws clause. Interceptor methods are allowed to catch and suppress exceptions and to recover by calling the theInvocationContext.proceed method."

B. The EJB spec requirements on the timeout method: 13.2.5.3Timeout Callback Method Requirements

void () void (Timer timer)

"Timeout callback methods must not throw application exceptions."

C. The interceptor spec requirements on around-invoke and around-timeout method signatures

2.5Business Method Interceptors

Object (InvocationContext) throws Exception

2.7Timeout Method Interceptors

Object (InvocationContext) throws Exception

============

As you can see, not only the around-timeout returns a value that the method it interposes on doesn't, but it also must declare the "throws Exception" clause while the target instance method can only throw RuntimeException's.

The around-invoke requirement to declare "throws Exception" does not allow to be more specific.

PROPOSED CHANGES

There are 2 ways to fix the problem. Unless I hear an overwhelming support for #1, and overwhelming rejection of both options (#3), I'll go with option #2 to reduce the amount of changes in this version of the Interceptors spec.

1

2

3

The proposed changes do not make any sense

Affected Versions

[1.2]

glassfishrobot commented 11 years ago

Reported by mvatkina

glassfishrobot commented 11 years ago

mvatkina said: Added notes as described in #2

glassfishrobot commented 11 years ago

Was assigned to mvatkina

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA INTERCEPTORS_SPEC-8

glassfishrobot commented 11 years ago

Marked as fixed on Monday, February 11th 2013, 3:53:13 pm