I have 2 dependent applications. When my child application up we update some more beans and refresh the AnnotationconfigwebapplicationContext object, but after refresh the context my MqttConnection object gets started being connected and disconnect.
I don't want to refresh my Mqttconnection object.
Please suggest how I can ignore/remove the MqttConnection object from AnnotationconfigwebapplicationContext before the refresh.
static{
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
context.regirster(MqttConnection.class);
context.register(Config.class);
if(checkChildServiceup()){
Class<?>[] configClasses = getServletConfigClasses();
if (!ObjectUtils.isEmpty(configClasses)) {
this.context.register(configClasses);
}
this.context.refresh();
}
}
public static Class<?> getServletConfigClasses(){
retrun new Class[]{AppConfig.class,devService.class,DbConfiguration.class};
}
public boolean static checkChildServiceup(){
while(true){
if(up){
return true;
break;
}
}