Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
Instructor: Alrighty, let's go ahead
and get started.
Just take care of our normal housekeeping
stopping all the apps and closing all the windows.
And let's just do a little copy paste
on this 05-primary.
And then we'll rename it as
06-lazy-initialization.
Now let's go ahead
and open this project up and IntelliJ.
What I'd like to do here is change the code bag
to using the qualifier annotation
and removing the primary annotation.
And we'll set the qualifier annotation here
to make use of the CricketCoach.
And we'll open up the TrackCoach implementation
and remove the @Primary annotation.
Now let's go ahead and run the application
just to make sure everything still works as desired.
Accessing this endpoint localhost:8080/dailyworkout,
and we're getting the CricketCoach workout
practice our fast bowling for 15 minutes.
Okay, this is great.
What I'd like to do here is add some diagnostics here
or add some print line statements to the constructors
just so we can see everyone being created
when the application starts up.
I'll just start here at the top with BaseballCoach.
And I'll add a no argument constructor here
for BaseballCoach.
And I'll add a system out print line here
to display the actual class name.
And I'll just copy this information
and I'll move over to CricketCoach,
and I'll paste in the information.
I'll update the constructor name - CricketCoach,
and then we have our existing code here
for printing out the actual class name.
Move over to TennisCoach.
Do more of the same -
well, actually, I can't paste that.
Let me swing back to CricketCoach.
Grab this constructor information, copy it,
swing back over to TennisCoach,
and now I can paste it.
And then update the actual constructor name accordingly.
And then more the same here for TrackCoach.
And I'll copy this print line statement
and I'll use that print line statement
in my demo controller.
It's on this demo controller here
where we do the injection.
I'll also paste in that print line statement
and that piece should be in place.
Okay, great.
So, this coding all looks pretty good.
I've added all the diagnostics here
for the various classes here that we're using
in this example.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.