사용자 도구

사이트 도구


springframework:scope

문서의 이전 판입니다!


Spring Bean Scope

prototype

구현방법 Provider<T>

@Autowired
private Provider<PrototypeBeanClass> prototypeBeanClassProvider;
 
...
PrototypeBeanClass bean = prototypeBeanClassProvider.get();
...

@Lookup

  • @Lookup 메소드를 호출하면 매번 새로운 객체를 생성해준다. @Lookup
@Component
public class SingletonLookupBean {
 
    @Lookup
    public PrototypeBean getPrototypeBean() {
        return null;
    }
}

request/session

springframework/scope.1537174996.txt.gz · 마지막으로 수정됨: 2018/09/17 18:03 저자 kwon37xi