<bean id="profiler" class="com.xyz.profiler.Profiler"
factory-method="aspectOf">
<property name="profilingStrategy" ref="jamonProfilingStrategy"/>
</bean>
An equivalent in JavaConfig would be:
@Bean
public com.xyz.profiler.Profiler profiler() {
com.xyz.profiler.Profiler profiler = com.xyz.profiler.Profiler.aspectOf();
profiler.setProfilingStrategy(jamonProfilingStrategy());
return profiler;
}
However, this only seems to work if the `Profiler` aspect is written in native aspectj `.aj` syntax. If it is written in Java and annotated with `@Aspect`, I get the following error message:
The method aspectOf() is undefined for the type Profiler
Is there an equivalent way of writing this using JavaConfig for aspects written with @AspectJ syntax?
I suspect that there is some conflict between the java compiler and ajc where it is not seeing the properly compiled version of the aspect. But I have checked the .class file for the aspect and see that the `aspectOf` method is indeed present.
Any ideas what this is happening with the @AspectJ coding style?
Thanks,
Eric