I've seen in many example the use of @Autowire in spring on a method. For example in configuration file:
@Component
public class SomeConfigFile{
@Autowire
public void someMethod(SomeBeanInstance someBean){
//bla bla
}
I guess someBean in my example above injected to the method by Spring but when does this method is called? and how calls it?
Marks a constructor, field, setter method, or config method as to be autowired by Spring's dependency injection facilities. This is an alternative to the JSR-330 Inject annotation, adding required-vs-optional semantics.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments