]
Norman Richards closed JBSEAM-3950.
-----------------------------------
Fix Version/s: 2.1.2.CR1
Resolution: Done
Assignee: Norman Richards
There's no harm in adding a warning for this.
Done.
Interceptor sort order: log a warning if around or within clause
contains bad InterceptorType
---------------------------------------------------------------------------------------------
Key: JBSEAM-3950
URL:
https://jira.jboss.org/jira/browse/JBSEAM-3950
Project: Seam
Issue Type: Feature Request
Components: Core
Affects Versions: 2.1.1.GA
Environment: Seam Trunk source code
http://fisheye.jboss.org/browse/Seam/trunk/src/main/org/jboss/seam/Compon...
Reporter: Julien Kronegg
Assignee: Norman Richards
Priority: Minor
Fix For: 2.1.2.CR1
Original Estimate: 4 hours
Remaining Estimate: 4 hours
In the Component class, Interceptors are separated between client-side and server-side
interceptors by mean of the @Interceptor's InterceptorType type property (see
Component.addInterceptor(Interceptor)).
The Interceptor's around and within properties allows to define the sort order (see
also Component.newSort(List)).
Problem:
Since the client-side and server-side Interceptors are stored in two different lists, and
since client-side interceptors are prioritary over server-side Interceptors, the
programmer may write around/within clause that are ignored. For example, he may want to
put a server-side Interceptor around a client-side Interceptor.
In the current Component code, these cases are simply ignored.
Solution:
In case of bad server-side / client-side mix in the Interceptor annotation definition,
the newSort(List) method should raise a warning.
Proposition:
- insert after line 1020:
if (interceptorAnn.type()==InterceptorType.SERVER &&
cl.getAnnotation(Interceptor.class).type()==InterceptorType.CLIENT )
log.warn("Interceptor "+clazz.getName()+": a server-side
Interceptor cannot be around the client-side Interceptor "+cl.getName()+" since
client-side Interceptors are always prioritary");
- insert after line 1025:
if (interceptorAnn.type()==InterceptorType.CLIENT &&
cl.getAnnotation(Interceptor.class).type()==InterceptorType.SERVER)
log.warn("Interceptor "+clazz.getName()+": a client-side
Interceptor cannot be within the server-side Interceptor "+cl.getName()+" since
client-side Interceptors are always prioritary");
Pros:
- programmer friendly
Cons:
- sorting takes (a bit) more time
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: