프로토 타입 범위로 스레드를 autowire 할 때 문제가 발생하는지 궁금합니다.@Autowired 및 Threads에 대한 함점
스레드 :
...
@Service
@Scope("prototype")
public class MyThread extends Thread {
...
}
스레드 시작 클래스 :
...
public class ThreadStarter {
@Autowired
private MyThread myThread;
public void startThread(){
myThread.start();
}
}
출발 클래스는 웹 서비스 구현에서 호출됩니다.
고려해야 할 함정이 있습니까?