I want to be able to autowire a singleton bean (foo)
foo
@Component public class FooUser { @Autowire Foo foo; }
created by ano
You need java-config - the @Bean annotation.
Define your class as @Configuration and your method as @Bean
@Configuration
@Bean