hi everyone,
i am using method Interceptor to intercept methods (AOP).
i am able to intercept the method, the method returns a collection of objects which i want to manipulate i.e. i want to manipulate the collection.
i am able to access the intercepted method but not able to access the collection returned by the method. here is the code which i have written:
public class RowLevelAdvice implements MethodInterceptor {
public Object invoke(MethodInvocation methodInvocation) throws Throwable {
HibernateDaoSupport dao = (HibernateDaoSupport) methodInvocation.getThis();
Session s = SessionFactoryUtils.getSession(dao.getSessionFactory(), true);
if (dao instanceof DomainDaoHibernate) {
System.out.println("Trapped Domain Dao: " + methodInvocation.getMethod().getName().toString());
}
final Object o = methodInvocation.proceed();
return o;
}
}
The invoke method is where i want to manipulate the interface. Any help is highly commendable.
Regards.
|