Giriş
Açıklaması şöyle.
Şöyle yaparız. getPrototypeService() metodu null dönmek zorunda. PrototypeBean sınıfı ise @Scope("prototype") anotasyonu ile işaretli olmalı.
Açıklaması şöyle.
A method annotated with @Lookup tells Spring to return an instance of the method’s return type when we invoke it.Örnek
Şöyle yaparız. getPrototypeService() metodu null dönmek zorunda. PrototypeBean sınıfı ise @Scope("prototype") anotasyonu ile işaretli olmalı.
@Component
public class SingletonFacade {
   @Lookup
   public PrototypeBean getPrototypeService() {
       return null;
   }
} 
Hiç yorum yok:
Yorum Gönder