2011/6/21 David Blevins <[email protected]> > > On Jun 20, 2011, at 2:23 AM, Ivan wrote: > > > Hi, > > I am looking at some interceptor samples, and after investigating some > > failures, it looks to me that the issue is caused by two different method > > level OVERLOADED_METHOD, EXACT_METHOD. Per the interceptor specification, > it > > only defines three level method. class and default (aka. package in > OpenEJB > > codes). > > I'm not sure that's entirely complete. If there's an overloaded > interceptor binding that says 'excludeDefaultInterceptors=true' and specific > method binding that says 'excludeDefaultInterceptors=false' than for that > one method the default interceptors should be included and for the others > with the same name but different arguments the default interceptors would > not be excluded. >
It looks to me that, in current interceptor specification, overloaded method style is an way to configure the interceptors for all these methods at once, rather than configure for them one by one. In the scenario you mentioned, current interceptor specification did not have special description for it, I think that the current behavior should be that the first one in the list takes action, the later will be ignored. If we hope to keep the current two method levels, we might need an extra flag in the interceptor binding info, and re-sort the final result, while it might looks a little strange. > > The second issue is that, the spec requires that the interceptor > configured > > in the deployment script must be invoked after those from annotations. > > Do we have a spec reference for that one? There were certainly no > discussions of this in EJB 3.0 when we added interceptors, or rather there > were and that's what <interceptor-order> is for. > > The description is interceptor spec : ---> The deployment descriptor may be used to augment the interceptors and interceptor methods defined by means of annotations. When the deployment descriptor is used to augment the interceptors specified in annotations, the interceptor methods specified in the deployment descriptor will be invoked after those specified in annotations, according to the ordering specified earlier. The interceptor-order deployment descriptor element may be used to over- ride this ordering. <--- > Are we only having issues with order? I.e. not in terms of our code, but > in the strict terms that we are producing the right set of interceptors but > they are stacked in the wrong order. > > Or are we having issues also where we are including the wrong interceptors > as well? The first scenario, there will be some wrong interceptors are included, and for the latter one, it is just the order issue. > > -David > > -- Ivan
