There is no direct equivalent of <context:load-time-weaver/> in @Configuration classes. Generally, where namespaces (like <context:*/>) are needed, it's recommended that you use the @ImportResource annotation to import just the snippet of XML that you need. e.g.:
Code:
@Configuration
@ImportResource("classpath:load-time-weaving.xml")
public class AppConfig {
@Bean
public AccountService accountService() {
return new DefaultAccountService(...);
}
}
load-time-weaving.xml:
Code:
<beans ...>
<context:load-time-weaver/>
</beans>
Feel free to raise a feature request about first-class support for load-time-weaving against the AnnotationConfigApplicationContext API and/or @Configuration programming model.