RegularExpressionMethodPointcut Class In Spring AOP
RegularExpressionMethodPointcut class is going to verify whether the method name of the class is matching with the given regular expression or not. If matches then those methods are eligible to get Advices. While configuring these classes into xml file, we are going to configure any one of following 2 properties..
<bean id="id1" class="org.spfw.aop.support.RegularExpressionMethodPointcut"> <property name="pattern"> <value>get.*N.+[0-9]</value> </property> </bean>
According to above configuration, a method name should start with get, and between get and letter N there should be one or more characters and finally that should end with a digit. If method name satisfies this pattern then it is eligible for getting advices.
While working with regular expressions, we have following indications..
. – matches for single character
.* – matches for zero [or] more characters
.+ – matches for 1 [or] more characters
.? – matches for zero [or] 1 character
[A-Z] – matches for an upper case alphabet
[abc] – matches for either a or b or c
[0-9] – matches for a digit
If we want to configure multiple regular expressions then we need to configure patterns property with list as NameMatchMethodPointcut, will see the example in the next article.
::. About the Author .::
Thanks to java4s for giving the wonderful tutorial.But where is the rest of the topics in Spring AOP i.e., Dynamic PointCut etc..???Am excepting you to finish this AOP Tutorial ASAP.
Where is the rest of the part….it is really good..but need to complete rest of the topic with detailed example and explanation
please post dynamic pointcut in aop of spring framework
please post in what are the ways to integrate spring with hibernate and explain them?
from my analysis 2 ways
1. by using hibernate template class
2. by using MVC with DAO design pattern
please tell me other ways
Hi Sivateja…. Nice website for easy learning as you website tag line saying “get it your self”. 🙂
You said at starting there are 9 concepts in AOP (Aspect,Advice,JoinPoint,Pointcut,Introduction,Target,Proxy,Weaving,Adviser), so far we covered 4 concepts only. What about other concepts? those not much used or you are going to cover those soon?
looking ahead for remaining concepts(Introduction,Target,Proxy,Weaving,Adviser).
please provide spring JPA concepts