Так как ваш класс потока не управляется Spring, вы не сможете внедрить bean-компоненты, управляемые пружиной, в класс S3Thread.
Для этого вам нужно создать класс или фабрику, которые должны быть подключены к жизненному циклу весны.
Как только вы овладеете этим классом, вы можете получить соответствующий bean-компонент и передать ссылку на / или использовать непосредственно в классе S3Thread. Как то так
@Component
public class ApplicationContextUtils implements ApplicationContextAware {
private static ApplicationContext ctx;
@Override
public void setApplicationContext(ApplicationContext appContext)
{
ctx = appContext;
}
public static ApplicationContext getApplicationContext() {
return ctx;
}
}
public class S3Thread implements Runnable {
@Override
public void run() {
Automation config = new Automation("user1","success");
IAutomationService automationService=
ApplicationContextUtils.getApplicationContext().getBean(IAutomationService .class);
automationService.updateAutomation(config);
}
}