org.apache.camel.main.RoutesCollector Java Examples

The following examples show how to use org.apache.camel.main.RoutesCollector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CamelMainRecorder.java    From camel-quarkus with Apache License 2.0 5 votes vote down vote up
public RuntimeValue<CamelMain> createCamelMain(
        RuntimeValue<CamelContext> runtime,
        RuntimeValue<RoutesCollector> routesCollector,
        BeanContainer container) {
    CamelMain main = new CamelMain(runtime.getValue());
    main.setRoutesCollector(routesCollector.getValue());
    main.addMainListener(new CamelMainEventBridge());

    // autowire only non null values as components may have configured
    // through CDI or from a Build Item thus those values should not be
    // overridden
    main.configure().setAutowireComponentPropertiesNonNullOnly(true);

    // properties are loaded through MicroProfile Config so there's
    // no need to look for sources.
    main.setDefaultPropertyPlaceholderLocation("false");

    // xml rest/routes should be explicitly configured as an
    // additional dependency is required thus, disable auto
    // discovery
    main.configure().setXmlRoutes("false");
    main.configure().setXmlRests("false");

    // register to the container
    container.instance(CamelMainProducers.class).setMain(main);

    return new RuntimeValue<>(main);
}
 
Example #2
Source File: CamelAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
@Bean
@ConditionalOnMissingBean(CamelSpringBootApplicationListener.class)
CamelSpringBootApplicationListener routesCollectorListener(ApplicationContext applicationContext, CamelConfigurationProperties config,
                                                           RoutesCollector routesCollector) {
    Collection<CamelContextConfiguration> configurations = applicationContext.getBeansOfType(CamelContextConfiguration.class).values();
    return new CamelSpringBootApplicationListener(applicationContext, new ArrayList(configurations), config, routesCollector);
}
 
Example #3
Source File: CamelSpringBootApplicationListener.java    From camel-spring-boot with Apache License 2.0 5 votes vote down vote up
public CamelSpringBootApplicationListener(ApplicationContext applicationContext, List<CamelContextConfiguration> camelContextConfigurations,
                                          CamelConfigurationProperties configurationProperties,
                                          RoutesCollector springBootRoutesCollector) {
    this.applicationContext = applicationContext;
    this.camelContextConfigurations = new ArrayList<>(camelContextConfigurations);
    this.configurationProperties = configurationProperties;
    this.springBootRoutesCollector = springBootRoutesCollector;
}
 
Example #4
Source File: CustomRoutesCollectorRecorder.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
public RuntimeValue<RoutesCollector> createSupportCollector() {
    return new RuntimeValue<>(new CustomRoutesCollector());
}
 
Example #5
Source File: CamelRoutesCollectorBuildItem.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
public CamelRoutesCollectorBuildItem(RuntimeValue<RoutesCollector> value) {
    this.value = value;
}
 
Example #6
Source File: CamelRoutesCollectorBuildItem.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
public RuntimeValue<RoutesCollector> getValue() {
    return value;
}
 
Example #7
Source File: CamelMainRecorder.java    From camel-quarkus with Apache License 2.0 4 votes vote down vote up
public RuntimeValue<RoutesCollector> newRoutesCollector(
        RuntimeValue<RegistryRoutesLoader> registryRoutesLoader,
        RuntimeValue<XMLRoutesDefinitionLoader> xmlRoutesLoader) {

    return new RuntimeValue<>(new CamelMainRoutesCollector(registryRoutesLoader.getValue(), xmlRoutesLoader.getValue()));
}
 
Example #8
Source File: CamelAutoConfiguration.java    From camel-spring-boot with Apache License 2.0 4 votes vote down vote up
@Bean
@ConditionalOnMissingBean(RoutesCollector.class)
RoutesCollector routesCollector(ApplicationContext applicationContext) {
    return new SpringBootRoutesCollector(applicationContext);
}