Newsletter |
NameMatchMethodPointcut Class In Spring AOP
NameMatchMethodPointcut class is going to verify whether the method names of a spring bean class are matching with the given criteria or not. While configuring this pointcut class into xml, we use mappedName or mappedNames property of the class into xml file. This class is a predefined class, so we need to configure the class directly into xml file like..
<bean id="id1" class="org.spfw.aop.support.NameMatchMethodPointcut"> <property name="mappedName"> <value>set*</value> </property> </bean>
Means the pointcut class identifies that setter methods of the bean class are eligible for getting advices. If there is no commonalities in method names we can provide individual method names by configuring mappedNames property.
mappedNames is the collection type List :-), so we need <list>—-</list> element while configuring the collection, hmm some thing..
<bean id="id1" class="org.spfw.aop.support.NameMatchMethodPointcut"> <property name="mappedNames"> <list> <value>method1</value> <value>method2</value> <value>method3</value> </list> </property> </bean>
According to above configuration, method names with method1, method2, method3 are only eligible to get advices, we will see the example in the next article, stay tuned.
You Might Also Like
::. About the Author .:: | ||
your website tutorial very simple.so its easily understand.i am beginning level developer.so its very useful for me .thank u very much…….
sir, waiting for the next article…
examples on pointcut
Awesome tutorial
Hi,
when i give method names in a list for mappedNames i get an exception like this.”java.lang.IllegalStateException: Cannot convert value of type [java.util.ArrayList] to required type [java.lang.String] for property ‘mappedName'”
Bayya nuv keka