I want to trigger a method when a particular method from another class is invoked that is why I thought of using @Pointcut.
The code below is almost identical to the that I am coding and I don't what else I have to add.
public class OrgManagerImpl implements OrgManager {
public IOrg getOrg(String orgShortName) {
}
}
and this is the class that will should be triggered:
@Aspect
public class OrgManagerSynchronizer {
@Pointcut("execution(* com.alvin.OrgManager.getOrg(..))")
public void classMethods() {}
@Before("classMethods()")
public void synchronize(JoinPoint jp) {
//code should be executed. but does not execute.
}
}
and in my .xml this was specified:
aop:aspectj-autoproxy
What more should I add? What to do next?
OrgManagerSynchronizerincomponent:scan? - Ajinkya