return false;
}
LOG.trace("Checking whether to register {} from route: {}", service, route);
ManagementAgent agent = getManagementStrategy().getManagementAgent();
if (agent == null) {
// do not register if no agent
return false;
}
// always register if we are starting CamelContext
if (getCamelContext().getStatus().isStarting()) {
return true;
}
// register if always is enabled
if (agent.getRegisterAlways()) {
return true;
}
// is it a known route then always accept
if (route != null && knowRouteIds.contains(route.getId())) {
return true;
}
// only register if we are starting a new route, and current thread is in starting routes mode
if (agent.getRegisterNewRoutes()) {
// no specific route, then fallback to see if this thread is starting routes
// which is kept as state on the camel context
return getCamelContext().isStartingRoutes();
}