if (context.getNameStrategy() instanceof DefaultCamelContextNameStrategy) {
// use this as the fixed name
LOG.warn("Reassigned auto assigned name on CamelContext from: " + context.getName()
+ " to: " + name + " due to clash with existing name already registered in MBeanServer.");
// now set the fixed name we are using onwards
context.setNameStrategy(new ExplicitCamelContextNameStrategy(name));
} else {
LOG.warn("This CamelContext(" + context.getName() + ") will be registered using the name: " + managementName
+ " due to clash with an existing name already registered in MBeanServer.");
}
}