try {
List<CamelJbiEndpoint> services = new ArrayList<CamelJbiEndpoint>(activatedEndpoints);
activatedEndpoints.clear();
ApplicationContext applicationContext = springLoader.getApplicationContext();
SpringCamelContext camelContext = SpringCamelContext.springCamelContext(applicationContext);
// now lets iterate through all the endpoints
Collection<Endpoint> endpoints = camelContext.getSingletonEndpoints();
for (Endpoint endpoint : endpoints) {
if (component.isEndpointExposedOnNmr(endpoint)) {
services.add(component.createJbiEndpointFromCamel(endpoint));
}
}
// lets add a control bus endpoint to ensure we have at least one endpoint to deploy
BeanComponent beanComponent = camelContext.getComponent("bean", BeanComponent.class);
Endpoint endpoint = beanComponent.createEndpoint(new CamelControlBus(camelContext), "camel:controlBus");
services.add(component.createJbiEndpointFromCamel(endpoint));
return services;
} catch (Exception e) {