|
+1
I am already implementing it by adding a “name” attribute to ServiceInterceptorContribution (and its impl class and the code that builds it)...
public String getName() { if( _name == null ) { return getFactoryServiceId(); } return _name; }
Then, in ServicePointImpl, I changed…
orderer.add(sic, sic.getFactoryServiceId(), sic.getPrecedingInterceptorIds(), sic .getFollowingInterceptorIds());
to…
orderer.add(sic, sic.getName(), sic.getPrecedingInterceptorIds(), sic .getFollowingInterceptorIds());
So far, it hasn’t broken any test cases, and I’m adding in new ones to test the functionality. I will send you guys a patch first before I commit, since I’m new to this whole thing and I’m scared that I’ll screw something up!
-----Original Message-----
--> Has anyone else come up with a way to do this cleanly? I think one big step in the right direction would be support for overriding the interceptor’s name, replacing the factory’s id with something else. This way, we could define ONE service interceptor factory which inserts a MethodInterceptor defined elsewhere in the registry (or inline maybe) and the interceptors could still be ordered, since they could have unique names. We could leave it backward compatible, of course, defaulting the interceptor name to the service id of the interceptor factory.
<interceptor service-id=”hivemind.lib.MethodInterceptorFactory” name=”security”> <impl object=”service:mymodule.SecurityInterceptor” /> </interceptor>
<interceptor service-id=”hivemind.lib.MethodInterceptorFactory” name=”logging” before=”security”> <impl object=”instance:com.myco.myproject.interceptor.LoggingInterceptor” /> </interceptor>
Here, we have defined a service interceptor using another service and one using just a plain ole object. What do you guys think?
-----Original
Message-----
--> Hello, All. Since the AOPAlliance Service Interceptors support didn’t make it into 1.1, when can we expect that to become available? I would like to discuss service interceptors in my article, but there is NO WAY that I’m going to try to explain how to do it using Javassist. I would like to use the AOPAlliance stuff.
James |
- Re: <bean> element Johan Lindquist
- RE: <bean> element James Carman
- Re: <bean> element Johan Lindquist
- RE: <bean> element James Carman
- Re: <bean> element Johan Lindquist
- Re: <bean> element Harish Krishnaswamy
- Re: <bean> element Albert Kwong
- RE: <bean> element Jean-Francois Poilpret
- RE: AOPAlliance Service Interceptors... James Carman
- Re: AOPAlliance Service Interceptors... Knut Wannheden
- Re: AOPAlliance Service Interceptors... James Carman
- Re: AOPAlliance Service Interceptors... Knut Wannheden
- RE: AOPAlliance Service Interceptors..... James Carman
- RE: AOPAlliance Service Intercepto... James Carman
- Re: AOPAlliance Service Intercepto... Knut Wannheden
- Re: AOPAlliance Service Interceptors... Howard Lewis Ship
- RE: AOPAlliance Service Interceptors... James Carman
- Re: AOPAlliance Service Interceptors..... Knut Wannheden
- RE: AOPAlliance Service Intercepto... James Carman
- RE: AOPAlliance Service Inter... James Carman
- Re: AOPAlliance Service I... Knut Wannheden
