¿Cómo puedo decirle a Spring que ejecute ese método init? Necesito obtener la clase Proxied Async y hacer una inicialización con ella.Configuración de primavera Método Init
@Configuration
@EnableAsync
public class Config {
@Bean
public AsyncBean asyncProxyBean(){
return new AsyncBean();
}
public void init(){
doStuffWithProxy(asyncProxyBean());
}
@Bean
public String thisIsHack(){ //this runs the init code but bean is a bit hacky
doStuffWithProxy(asyncProxyBean());
return "";
}
}
En mi caso, el representante es un AsyncEventHandler y necesita registrar el manipulador con el productor del evento. –