public Object createPerJoinpoint(Advisor advisor, Joinpoint jp) { // We have to do this until AOP supports matching based on annotation attributes TransactionManagementType type = TxUtil.getTransactionManagementType(advisor); if (type != TransactionManagementType.BEAN) return new NullInterceptor(); TransactionManager tm = TxUtil.getTransactionManager(); boolean stateful = advisor.resolveAnnotation(Stateful.class) != null; // Both MessageDriven and Stateless are stateless if(stateful) return new StatefulBMTInterceptor(tm); else return new StatelessBMTInterceptor(tm); } }