salut

afin de lancer un thread au démarrage d'une application spring-boot, j'ai créé ce code.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
@Component
public class ScanApplicationStartup implements ApplicationListener<ApplicationReadyEvent> {
 
  @Override
  public void onApplicationEvent(final ApplicationReadyEvent event) {
 
    ScanRead sc = new ScanRead();
 
    sc.run();
  }
 
}
comment accéder à ce thread dans un controller par exemple?

merci.