の注釈FichierCommunRetriever
を使用するクラスがあります。しかし、私はそれを機能させるのに苦労しています。@Value
Spring
だから私application.properties
は持っています:
application.donneeCommuneDossier=C\:\\test
application.destinationDonneeCommuneDossier=C\:\\dev\\repertoireDonneeCommune\\Cobol
私のクラスFichierCommunRetriever
は、次のコードでこれらのエントリを使用しています:
public class FichierCommunRetriever implements Runnable {
@Value("${application.donneeCommuneDossier}")
private String fichierCommunDossierPath;
@Value("${application.destinationDonneeCommuneDossier}")
private String destinationFichierCommunDossierPath;
}
application.properties
クラスに次のコードをロードしていますApplicationConfig
。
@ImportResource("classpath:/com/folder/folder/folder/folder/folder/applicationContext.xml")
では、そのような新しいスレッドで使用する をApplicationConfig
定義しています:bean
FichierCommunRetriever
Thread threadToExecuteTask = new Thread(new FichierCommunRetriever());
threadToExecuteTask.start();
私の問題は、FichierCommunRetriever
別のスレッドで実行されているため、クラスがに到達できずapplicationContext
、値を与えることができないことだと思います。
注釈が機能するかどうか、またはそれらの値を取得する方法を変更する必要があるかどうか疑問に思っていますか?