class TehAwesome { @Autowired public void setStuff(Stuff stuff) { ... } } ... then this is kind of ironic, right? <context:component-scan base-package="com.win"/>
main(String... args) { ApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class); // retrieve the bean we want to use in type-safe fashion QuoteService quoteService = ctx.getBean(QuoteService.class); System.out.println(quoteService.currentValue("AAPL")); } }
class TehAwesome { @Autowired public void setStuff(Stuff stuff) { ... } } ... then this is kind of ironic ... <context:component-scan base-package="com.win"/>
just registering the @Scheduled bean // post processor on your behalf public ScheduledAnnotationBeanPostProcessor sabpp() { return new ScheduledAnnotationBeanPostProcessor(); } }
new LocalSessionFactoryBuilder(dataSource()) .addAnnotatedClasses(Person.class, Account.class) .buildSessionFactory(); } @Bean public PersistenceExceptionTranslator exTranslator() { return new HibernateExceptionTranslator(); }
is definitely not going anywhere. This is a concern that commonly comes up when we talk about annotations and such, but we've said it before and we'll say it again: XML was, is, and ever will be a first class citizen in Spring. The changes in 3.1 just mean that if you don't want XML, you don't have to use it. That's all. kthx, bye.