0
當singleton bean被注入到請求範圍的bean中時,它被注入到singleton範圍的bean中是否常見? 例如,像這樣:是否適用於高負載彈簧應用?
@Scope(value="request", proxyMode=ScopedProxyMode.INTERFACES)
public class CurrentUser {
@Resource
private UserRepository userRepository;
...
}
public class ApplicationController {
@Autowired
private CurrentUser currentUser;
...
}
是對內存管理的任何管理費用可能嗎?這個實現是否安全? 謝謝!
謝謝!關於proxyMode = ScopedProxyMode.INTERFACES - 我知道這一點,謝謝。我縮短了繼承細節。 –