/** * @deprecated its better to create and boot Spring the standard Spring way and to get hold of CamelContext * using the Spring API. */ @Deprecated public static SpringCamelContext springCamelContext(ApplicationContext applicationContext) throws Exception { return springCamelContext(applicationContext, true); }
/** * @deprecated its better to create and boot Spring the standard Spring way and to get hold of CamelContext * using the Spring API. */ @Deprecated public static SpringCamelContext springCamelContext(String configLocations) throws Exception { return springCamelContext(new ClassPathXmlApplicationContext(configLocations)); }
@Override protected Collection<org.apache.servicemix.common.Endpoint> getServices( AbstractXmlApplicationContext applicationContext) throws Exception { List<org.apache.servicemix.common.Endpoint> services = new ArrayList<org.apache.servicemix.common.Endpoint>(activatedEndpoints); activatedEndpoints.clear(); SpringCamelContext camelContext = SpringCamelContext.springCamelContext(applicationContext); JbiComponent jbiComponent = camelContext.getComponent("jbi", JbiComponent.class); // now lets iterate through all the endpoints Collection<Endpoint> endpoints = camelContext.getEndpoints(); if (jbiComponent != null) { // set the SU Name jbiComponent.setSuName(serviceUnitName); for (Endpoint endpoint : endpoints) { if (component.isEndpointExposedOnNmr(endpoint)) { services.add(jbiComponent.createJbiEndpointFromCamel(endpoint)); } } // Here we just add a CamelContextEndpoint to delegate the servicemix start and stop lifecycle call CamelContextEndpoint camelContextEndpoint = new CamelContextEndpoint(camelContext, serviceUnitName); services.add(camelContextEndpoint); } return services; }