I want to be able to autowire a singleton bean (foo)
@Component
public class FooUser {
@Autowire Foo foo;
}
created by ano
Spring Components can also define factory methods. A snipped from the documentation:
@Component
public class FactoryMethodComponent {
@Bean @Qualifier("public")
public TestBean publicInstance() {
return new TestBean("publicInstance");
}
public void doWork() {
// Component method implementation omitted
}
}