8 Ekim 2018 Pazartesi

SpringContext ObjectFactory Arayüzü

getObject metodu
Şöyle yaparız.
@Componenet
public class SingletonFacade {

  @Autowired
  private ObjectFactory<PrototypeService> prototypeBeanObjectFactory;

  public PrototypeBean getPrototypeInstance() {
    return prototypeBeanObjectFactory.getObject();
  }
}

Hiç yorum yok:

Yorum Gönder