HibernateInterceptor をアドバイスとして使用しようとしており、自動配線しようとしています。
コードは次のとおりです。
@Aspect
public class InterceptorAdvice{
private HibernateInterceptor hibernateInterceptor;
@Autowired
public void setHibernateInterceptor(@Qualifier("hibernateInterceptor") HibernateInterceptor hibernateInterceptor) {
this.hibernateInterceptor = hibernateInterceptor;
}
@Around("execution(* *..*.dao..*.*(..))")
public Object interceptCall(ProceedingJoinPoint joinPoint) throws Exception {
Object obj = null;
try{
.......
}catch(Exception e){
e.printStackTrace();
}
return obj;
}
}
以下は私のXMLマッピングです。
<bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.HibernateInterceptor" autowire="byName">
<property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!--To enable AspectJ AOP-->
<aop:aspectj-autoproxy/>
<!--Your advice-->
<bean class="com.web.aop.InterceptorAdvice"/>
<!--Looks for any annotated Spring bean in com.app.dao package-->
<context:component-scan base-package="com.web.dao"/>
<!--Enables @Autowired annotation-->
<context:annotation-config/>
hibernateInterceptop をチェックすると、取得するのは NULL だけです :(...休止状態のインターセプターを自動配線できない理由がわかりません
何か案は?御時間ありがとうございます。
乾杯、J