-
Notifications
You must be signed in to change notification settings - Fork 38k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document use of Provider interface at injection point [SPR-13117] #17708
Comments
Juergen Hoeller commented I'm not entirely sure I understand your request: What you have in mind seems to be pretty much what Am I missing something? Juergen |
Caleb Cushing commented no I just somehow missed this when reading through the docs |
Caleb Cushing commented Maybe it would be a good time to improve reference docs? http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#beans-factory-scopes-other-injection doesn't mention either of these options, there is brief mention of ObjectFactory in custom scope but not as an option for injecting into singletons (though now reading again that that's not what you're saying). |
Caleb Cushing commented though I just renamed this issue to Document Providers, it might be worth considering allowing a Java 8 |
Juergen Hoeller commented I've added coverage of As for a Java 8 Juergen |
Caleb Cushing opened SPR-13117 and commented
Let's say I define a bean
and have another
that needs the request scoped instance of foo across multiple methods.
what I'd like to be able to write is something like this
to do this currently I am Autowiring ApplicationContext and calling getBean(...). I would like to wire something less flexible and have it work in a "magic" way. meaning I don't write the provider I just request one. I would also like implementing the provider to be easy for unit test purposes.
as a Note: I'd be ok if Provider was a new interface, or perhaps I could just request any Bean wrapped with Optional or ThreadLocal (or something I haven't thought of).
Issue Links:
@Inject
) ("is depended on by")Referenced from: commits a13a1eb
The text was updated successfully, but these errors were encountered: