I have below aspect.
@Around("somePublicMethod()")
public Object doAction(ProceedingJoinPoint call) throws Throwable {
SomeObject client = null;
Object result = null;
try
{
client = someDao.getResult();
Object[] allArgs = call.getArgs();
allArgs[allArgs.length-1] = client;
// Do the call, passing in the managed SiperianClientWrapper
result = call.proceed(allArgs);
}
catch(Exception ex)
{
throw ex;
}
I have one service method as below. This method is intercepted by above aspect
public SomeEntity getEntities(String name, String pwd, SomeObject client){
//some logic
}
above method is called as below.
someService.getEntities("name","pwd",null);
What aspect does is, SomeObject has null and null is replaced by some actual value.
My question is instead of passing null as a parameter value, is it possible to add an extra parameter using Reflection with in the Aspect? In my case SomeObject parameter can be added dynamically?
so that finally i have to call the service as someService.getEntities("name","pwd");
and the SomeObject will be added dynamically by Aspect?
Thanks!