@Bean
Jump to navigation
Jump to search
External
Internal
Overview
Register a Bean under a Specific Name
The following registers a MyComponent singleton under the name "blue":
@Configuration
public class ... {
@Bean("blue")
public MyComponent getMyComponent() {
return new MyComponent();
}
}