Add the injection point for the Provider

See gh-1100
This commit is contained in:
nkjackzhang 2016-07-07 16:11:40 +08:00 committed by Stephane Nicoll
parent 6aa5931e28
commit 6aeaa1976d
1 changed files with 5 additions and 0 deletions

View File

@ -5784,6 +5784,11 @@ other beans through a `Provider.get()` call. As a variant of the example above:
public class SimpleMovieLister {
private Provider<MovieFinder> movieFinder;
@Inject
public void setMovieFinder(Provider<MovieFinder> movieFinder) {
this.movieFinder = movieFinder;
}
public void listMovies() {
this.movieFinder.get().findMovies(...);