I am trying AOP parametrization for the first time. I would really appreciate if somebody could help me clear the following doubt.
I have a advice method around a given Business logic method. Is it possible to add a new parameter to my advice method and pass the value hard coded in the xml configuration?
Here i want my method to take one more parameter
<bean id="myAspect" class="com.mypackage.MyAspect" />
expression="execution(* com.mypackage.businessLogic(..))" />
method="doApectWork" returning="myObject" />
Apect Method being
public void doApectWork(JoinPoint jp, Object myObject)
and pass the same at deploy time through my xml configuration.
public void doApectWork(JoinPoint jp, Object myObject, myStaticParam)
Basically, what I am trying to achieve here is that if I have 2 Business Logic methods for the first one I want to apply an aspect with a static parameter and another aspect for the second business logic method with another static parameter and invoke the same method.
I cannot make this into two different methods as the parameter values play a role further in the code.
If this is not possible through aspect, is there any other way I can achieve the same using Spring.
Thanks in advance