|
From: Rod J. <rod...@in...> - 2004-01-05 09:16:15
|
Ross You're on the right track. There is actually a RegExpPointcut, which should enable you to move the matching rule into XML. Please feedback any comments about its usability, as we may try to improve it for 1.0 final. In general, the interceptor should not do matching, unless the matching is relevant to it's work (e.g. it behaves differently for methods starting with some prefix, returning void, or whatever). Even in that case, it might be better to use several simpler interceptors with corresponding pointcuts to facilitate reuse. Regards, Rod ----- Original Message ----- From: "Ross Mason" <ro...@at...> To: <spr...@li...> Sent: Monday, January 05, 2004 6:33 AM Subject: Re: [Springframework-developer] Method Interception By Name > Hi Matthew, > > I think you can create an Advisor such as > DefaultInterceptionAroundAdvisor add your MethodInterceptor as a ref and > also define a PointCut. The PointCut is a composition of a MethodMatcher > and ClassFilter. Your MethodMatcher implementation could accept, say a > regex (which can be configured in the applicationContext.xml) to filter > the correct methods. > > I haven't really played with the aop stuff so I may be off the mark, but > sounds sensible to me... ;-) > > Cheers, > > Ross > > btw Happy new year! > > Matthew E. Porter wrote: > > > I have written a class implementing MethodInterceptor. Currently, the > > class checks the method name to decide whether or not to apply the > > interceptor logic. I am curious if there is a better way to do this in > > Spring. It would be nice if there was a way to specify the method names > > in the applicationContext.xml. > > > > All help/advice is appreciated! > > > > > > Cheers, > > matthew > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: IBM Linux Tutorials. > > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign up for IBM's > Free Linux Tutorials. Learn everything from the bash shell to sys admin. > Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |