public ContextScanRouteBuilderFinder(SpringCamelContext camelContext, PackageScanFilter filter, boolean includeNonSingletons) { this.applicationContext = camelContext.getApplicationContext(); this.filter = filter; this.includeNonSingletons = includeNonSingletons; }
public PackageScanRouteBuilderFinder(SpringCamelContext camelContext, String[] packages, ClassLoader classLoader, BeanPostProcessor postProcessor, PackageScanClassResolver resolver) { this.camelContext = camelContext; this.applicationContext = camelContext.getApplicationContext(); this.packages = packages; this.beanPostProcessor = postProcessor; this.resolver = resolver; // add our provided loader as well resolver.addClassLoader(classLoader); }
@Override protected Registry createRegistry() { return new ApplicationContextRegistry(getApplicationContext()); }
/** * Returns the application context which has been configured via the * {@link #setApplicationContext(ApplicationContext)} method or from the * underlying {@link SpringCamelContext} */ public ApplicationContext getApplicationContext() { if (applicationContext == null) { CamelContext camelContext = getContext(); if (camelContext instanceof SpringCamelContext) { SpringCamelContext springCamelContext = (SpringCamelContext)camelContext; return springCamelContext.getApplicationContext(); } else { throw new IllegalArgumentException("This SpringBuilder is not being used with a SpringCamelContext and there is no applicationContext property configured"); } } return applicationContext; }
@Override public void start() throws Exception { ObjectHelper.notNull(getCamelContext(), "CamelContext", this); if (getCamelContext() instanceof SpringCamelContext) { ApplicationContext applicationContext = ((SpringCamelContext) getCamelContext()).getApplicationContext(); beanResolver = new BeanFactoryResolver(applicationContext); } else { beanResolver = new RegistryBeanResolver(getCamelContext().getRegistry()); } }
private EvaluationContext createEvaluationContext(Exchange exchange) { StandardEvaluationContext evaluationContext = new StandardEvaluationContext(new RootObject(exchange)); if (beanResolver != null) { evaluationContext.setBeanResolver(beanResolver); } else if (exchange.getContext() instanceof SpringCamelContext) { // Support references (like @foo) in expressions to beans defined in the Registry/ApplicationContext ApplicationContext applicationContext = ((SpringCamelContext) exchange.getContext()).getApplicationContext(); evaluationContext.setBeanResolver(new BeanFactoryResolver(applicationContext)); } else { evaluationContext.setBeanResolver(new RegistryBeanResolver(exchange.getContext().getRegistry())); } return evaluationContext; }
public SpringIntegrationProducer(SpringCamelContext context, SpringIntegrationEndpoint endpoint) { super(endpoint); this.destinationResolver = new BeanFactoryChannelResolver(context.getApplicationContext()); }
public static ApplicationContext getApplicationContext(CamelContext camelctx) { IllegalArgumentAssertion.assertTrue(camelctx instanceof SpringCamelContext, "Not an SpringCamelContext: " + camelctx); return ((SpringCamelContext)camelctx).getApplicationContext(); }
public static ApplicationContext getApplicationContext(CamelContext camelctx) { IllegalArgumentAssertion.assertTrue(camelctx instanceof SpringCamelContext, "Not an SpringCamelContext: " + camelctx); return ((SpringCamelContext)camelctx).getApplicationContext(); }
public SpringIntegrationConsumer(SpringIntegrationEndpoint endpoint, Processor processor) { super(endpoint, processor); this.context = (SpringCamelContext) endpoint.getCamelContext(); this.destinationResolver = new BeanFactoryChannelResolver(context.getApplicationContext()); }
/** * Create a CXF bus with either BusFactory or SpringBusFactory if Camel Context * is SpringCamelContext. In the latter case, this method updates the bus * configuration with the applicationContext which SpringCamelContext holds * * @param context - the Camel Context */ public static Bus createBus(CamelContext context) { BusFactory busFactory = BusFactory.newInstance(); if (context instanceof SpringCamelContext) { SpringCamelContext springCamelContext = (SpringCamelContext) context; ApplicationContext applicationContext = springCamelContext.getApplicationContext(); busFactory = new SpringBusFactory(applicationContext); } return busFactory.createBus(); } }
private void init(AbstractJAXRSFactoryBean bean) { this.bean = bean; if (bean instanceof BeanIdAware) { setBeanId(((BeanIdAware)bean).getBeanId()); } ApplicationContext applicationContext = ((SpringCamelContext)getCamelContext()).getApplicationContext(); configurer = new ConfigurerImpl(applicationContext); }
if (returnAddress != null) { if (returnAddress instanceof String) { reply = context.getApplicationContext().getBean((String)returnAddress, MessageChannel.class); } else if (returnAddress instanceof MessageChannel) { reply = (MessageChannel) returnAddress;