Spring @Lookup Method Injection | Bean Scopes | Interview QA | JavaTechie

  Рет қаралды 26,294

Java Techie

Java Techie

Күн бұрын

This tutorial will explain you to understand how can you inject prototype bean into singleton bean in spring using @Lookup method injection
Spring boot microservice course Offer will close soon so Hurry-up & Register today itself!
COURSE LINK : javatechie5246...
PROMO CODE : Java40
GitHub:
github.com/Jav...
Blogs:
/ javatechie
Facebook:
/ javatechie
guys if you like this video please do subscribe now and press the bell icon to not miss any update from Java Techie
Disclaimer/Policy:
--------------------------------
Note : All uploaded content in this channel is mine and its not copied from any community ,
you are free to use source code from above mentioned GitHub account

Пікірлер: 54
@FactsNationReal
@FactsNationReal Жыл бұрын
Very knowledgeable.. 👍
@gasparcalix2095
@gasparcalix2095 2 жыл бұрын
learning something i didn't know i need to learn, Excelente!
@pavanim6258
@pavanim6258 2 жыл бұрын
very well explained .Thank you so much for your crystal clear explanation
@punzzycool
@punzzycool 2 жыл бұрын
Very good explanation with appropriate example. Keep it up the good work
@abhaymishra8112
@abhaymishra8112 2 жыл бұрын
Good Topic. And nicely explained.
@sudheerkumar-tp1mg
@sudheerkumar-tp1mg 2 жыл бұрын
Deep knowledge
@avinashsakroji1811
@avinashsakroji1811 2 жыл бұрын
So nicely explained. Thanks for posting good contents on your channel.
@bugrae9341
@bugrae9341 2 жыл бұрын
So good and helpfull. I will wait another awesome video :D
@arvindpandey8793
@arvindpandey8793 Жыл бұрын
Great
@dedeepyaamasa4441
@dedeepyaamasa4441 2 жыл бұрын
As always you give quality content with explanation
@sahilbhasin2112
@sahilbhasin2112 2 жыл бұрын
Good, Can you cover real usecase for all bean scopes and in which best situation we can use other than default scope?
@Javatechie
@Javatechie 2 жыл бұрын
Okay I will
@utsavshrivastava9481
@utsavshrivastava9481 2 жыл бұрын
Great explanation
@tanujkumaragrawal4756
@tanujkumaragrawal4756 2 жыл бұрын
Thanks sir for keeping us updated
@midhunnair6932
@midhunnair6932 Жыл бұрын
Pls add this video under Interview QA playlist
@neha6000
@neha6000 2 жыл бұрын
Once again thousand of thanks 🙏
@PiyushDhanwani
@PiyushDhanwani 2 жыл бұрын
I have gone through all your angular vedios, but still there are many things which are not clear. It will be really helpful if you start a course to learn from Java script to reactive forms and then finally to angular framework.
@dasariravinder
@dasariravinder 2 жыл бұрын
You could add @Lazy on the ObjectFactory ... that should give the effect of @Lookup? pls clarify
@Javatechie
@Javatechie 2 жыл бұрын
I guess you didn't get context on both the approach
@thatoshebe5505
@thatoshebe5505 Жыл бұрын
Please share how we can unit test a method making use of @lookup bean
@andresflores4434
@andresflores4434 2 жыл бұрын
You are amazing. But i have a question for you. How could i set the value of the weather ? Something like this. Inside UseService public String setCurrentTempFromAnotherAPI(String time) { return getWeatherServiceBean().setTodaysTemp(time); } I''m trying but allways i get a null value.
@Javatechie
@Javatechie 2 жыл бұрын
Is this time you passed from controller
@artemief
@artemief 3 ай бұрын
Hi How can I test a method(let's call it methodA) in which I call a method(let's call it methodB) annotated with @LookUp? Right now I am getting a NullPointerException error when calling methodB inside methodA
@858Bikash
@858Bikash 2 жыл бұрын
Hi sir please make a video on singleton design pattern with all scenarios like (cloning, sterilization,thread safe tec.) with proper explanation
@Javatechie
@Javatechie 2 жыл бұрын
Bikash it is already there in my channel please search with keyword "singleton"
@pang-ca
@pang-ca 2 жыл бұрын
If we create 2 UserService, is the hashcode of them still the same after using @Lookup?
@Javatechie
@Javatechie 2 жыл бұрын
Yes of course why do you think different behaviour here
@kunalsharma-zc2ho
@kunalsharma-zc2ho Жыл бұрын
Hi Basant , One doubt can we use similar approach for call static method from Service bean ? if not how should solve . My findings is we can use App. Context . ?
@Javatechie
@Javatechie Жыл бұрын
Static method simply you can call using ClassName . No service bean instance required to call that
@kunalsharma-zc2ho
@kunalsharma-zc2ho Жыл бұрын
My Bad ...calling a bean class method inside a static method ?
@vrmupparaju
@vrmupparaju Жыл бұрын
since its prototype scope, container will not destroy the beans ,how bean will be destroyed ??
@Javatechie
@Javatechie Жыл бұрын
Why won't it be destroyed?
@TraveLnXploreWithDash
@TraveLnXploreWithDash 2 жыл бұрын
Bhai weekly one deveops content pls.
@Javatechie
@Javatechie 2 жыл бұрын
Bhai content also required . Almost all Devops I uploaded with separate playlist
@TraveLnXploreWithDash
@TraveLnXploreWithDash 2 жыл бұрын
@@Javatechie Thanks🙏
@sushantkumar2631
@sushantkumar2631 2 жыл бұрын
Sir make one video how to attend your class online from August 1
@Javatechie
@Javatechie 2 жыл бұрын
Sure buddy i will upload that tomorrow even I am thinking to make open session for 1st August let's see
@gourabbanik2043
@gourabbanik2043 2 жыл бұрын
Please make a video how to read data from xlsx Or xls and store in mysql Or any db
@Javatechie
@Javatechie 2 жыл бұрын
I guess I already did this in my spring batch video
@gourabbanik2043
@gourabbanik2043 2 жыл бұрын
@@Javatechie I didn't find it could you please share the link btw I asking about Apache poi dependency
@Javatechie
@Javatechie 2 жыл бұрын
My bad i thought your asking about XML but it's Excel let me check
@avinashshrivastava1512
@avinashshrivastava1512 2 жыл бұрын
I have taken your courses here i have one doubt if singleton bean inject in to prototype what will happen then
@Javatechie
@Javatechie 2 жыл бұрын
Ofcourse. You can always inject any type of bean. If you are defining the parent bean as Prototype and then you are trying to inject a Singleton into that, it will be injected. But, think if that is what you want to do. Singleton beans instance are created only once. The main reason behind creating the Prototype bean is to have new instance for each request. Still, the prototype bean will be created every request. But, the singleton bean will always be the same once you have injected.
@itsnarahari
@itsnarahari 2 жыл бұрын
Spring container will behave internally singleton only it will create one object if prototype
@Javatechie
@Javatechie 2 жыл бұрын
For singleton bean it will create only one instance and prototype it will behave as it is
@swapnilburde7268
@swapnilburde7268 2 жыл бұрын
Brother can you please use large font size so mobile users also view your code
@Javatechie
@Javatechie 2 жыл бұрын
Sure buddy will do that
@vedhvaishvikreddy1199
@vedhvaishvikreddy1199 2 жыл бұрын
Sir, prerequisite for spring microservice course.. ?
@Javatechie
@Javatechie 2 жыл бұрын
Spring core is enough
@sureshmanne7245
@sureshmanne7245 Жыл бұрын
What is the business scenario where a prototype bean passed into singleton bean?
@lordgreat6051
@lordgreat6051 2 жыл бұрын
Thank you sir but can you please make the fonts bigger it is difficult to see the code
@Javatechie
@Javatechie 2 жыл бұрын
It depends where are you watching if mobile then please fit it to screen. Thanks i will noted it and going forward will take care
@lordgreat6051
@lordgreat6051 2 жыл бұрын
@@Javatechie Thank you sir really appreciate it
@Hitesh-fe9cc
@Hitesh-fe9cc 3 ай бұрын
Solution: 8:20
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 65 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
Mom had to stand up for the whole family!❤️😍😁
00:39
Spring ultimate basics: What are Spring Beans and what is the Spring Container?
16:30
Deep Dive into Spring Bean Scopes: Types and Uses Explained
37:21
龟兔赛跑:好可爱的小乌龟#short #angel #clown
01:00
Super Beauty team
Рет қаралды 65 МЛН