Sorry, the final after-returning was (ie, no recursion):
@AfterReturning("beanCreation(beanInstance) &&
!cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configureBean(beanInstance);
}
Barry Kaplan wrote:
I cannot seem to get a cflow to work:
// @Pointcut("call(*
org.hibernate.engine.UnsavedValueFactory.instantiate(..)) &&
within(org.hibernate.engine.UnsavedValueFactory)")
@Pointcut("execution(*
org.hibernate.engine.UnsavedValueFactory.instantiate(..))")
void hibernateUnsavedValueFactory() {}
@Pointcut("initialization((@org.springframework.beans.factory.annotation.Configurable
*).new(..)) && this(beanInstance)")
void beanCreation(Object beanInstance) {}
// @Before("hibernateUnsavedValueFactory()")
public void test() {
throw new RuntimeException("*****");
}
@AfterReturning("beanCreation(beanInstance) &&
!cflow(hibernateUnsavedValueFactory())")
public void configure(Object beanInstance) {
configure(beanInstance);
}
The test() advice will trigger if uncommented. But the use of the
hibernateUnsavedValueFactory() pointcut in the cflow always
generates the NoSuchFieldException. I am using runtime weaving. I am
really confused.
-barry