Examples of SpringCamelContext


Examples of org.apache.camel.spring.SpringCamelContext

        BusFactory busFactory = BusFactory.newInstance();
        // need to check if the camelContext is SpringCamelContext and
        // update the bus configuration with the applicationContext
        // which SpringCamelContext holds
        if (getCamelContext() instanceof SpringCamelContext) {
            SpringCamelContext springCamelContext = (SpringCamelContext)getCamelContext();
            ApplicationContext applicationContext = springCamelContext.getApplicationContext();
            busFactory = new org.apache.cxf.bus.spring.SpringBusFactory(applicationContext);
        }
        return busFactory.createBus();
       
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

    public static Endpoint toEndpoint(final CxfSpringEndpointBean endpointBean) throws Exception {
        if (endpointBean == null) {
            throw new IllegalArgumentException("The CxfEndpoint instance is null");
        }
        // CamelContext
        SpringCamelContext context = SpringCamelContext.springCamelContext(endpointBean.getApplicationContext());
        // The beanId will be set from endpointBean's property       
        CxfEndpoint answer = new CxfSpringEndpoint(context, endpointBean);
        // check the properties map
        if (endpointBean.getProperties() != null) {
            Map<String, Object> copy = new HashMap<String, Object>();
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

        }
        this.bundleContext = bundleContext;
    }
   
    protected SpringCamelContext createContext() {
        SpringCamelContext ctx = newCamelContext();
        // only set the name if its explicit (Camel will auto assign name if none explicit set)
        if (!isImplicitId()) {
            ctx.setName(getId());
        }
        return ctx;
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

    }

    @Override
    protected CamelContext createCamelContext() throws Exception {
        spring = new ClassPathXmlApplicationContext("org/apache/camel/component/javaspace/spring.xml");
        SpringCamelContext ctx = SpringCamelContext.springCamelContext(spring);
        return ctx;
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

    public void setBundleContext(BundleContext bundleContext) {
        this.bundleContext = bundleContext;
    }
   
    protected SpringCamelContext createContext() {
        SpringCamelContext context = super.createContext();
        LOG.debug("The bundle context is " + bundleContext);
        if (bundleContext != null) {
            context.setComponentResolver(new OsgiComponentResolver());
            context.setLanguageResolver(new OsgiLanguageResolver());
            addOsgiAnnotationTypeConverterLoader(context, bundleContext);
            context.setFactoryFinderClass(OsgiFactoryFinder.class);
        }
       
        return context;
    }   
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

            // Get the bean from the Spring context
            beanId = address.substring(CxfConstants.SPRING_CONTEXT_ENDPOINT.length());
            if (beanId.startsWith("//")) {
                beanId = beanId.substring(2);
            }
            SpringCamelContext context = (SpringCamelContext) this.getCamelContext();           
            configurer = new ConfigurerImpl(context.getApplicationContext());
            cxfEndpointBean = (CxfEndpointBean) context.getApplicationContext().getBean(beanId);
            ObjectHelper.notNull(cxfEndpointBean, "cxfEndpointBean");
        }
       
        initializeHeadersRelaysMap();
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

        configurer.configureBean(beanId, beanInstance);
    }

    public ApplicationContext getApplicationContext() {
        if (getCamelContext() instanceof SpringCamelContext) {
            SpringCamelContext context = (SpringCamelContext) getCamelContext();
            return context.getApplicationContext();
        } else {
            return null;
        }
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

        };
    }

    protected CamelContext createCamelContext() throws Exception {
        spring = new ClassPathXmlApplicationContext("org/apache/camel/component/jms/spring.xml");
        SpringCamelContext ctx = SpringCamelContext.springCamelContext(spring);
        PlatformTransactionManager transactionManager = (PlatformTransactionManager)spring.getBean("jmsTransactionManager");
        ConnectionFactory connectionFactory = (ConnectionFactory)spring.getBean("jmsConnectionFactory");
        JmsComponent component = JmsComponent.jmsComponentTransacted(connectionFactory, transactionManager);
        component.getConfiguration().setConcurrentConsumers(1);
        ctx.addComponent("activemq", component);
        return ctx;
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

            //get the bean from spring context
            beanId = address.substring(CxfConstants.SPRING_CONTEXT_ENDPOINT.length());
            if (beanId.startsWith("//")) {
                beanId = beanId.substring(2);
            }
            SpringCamelContext context = (SpringCamelContext) this.getContext();
            configurer = new ConfigurerImpl(context.getApplicationContext());
            cxfEndpointBean = (CxfEndpointBean) context.getApplicationContext().getBean(beanId);
            assert cxfEndpointBean != null;
        }
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringCamelContext

        this.bundleContext = bundleContext;
    }


    protected SpringCamelContext createContext() {
        SpringCamelContext context = super.createContext();
        context.setComponentResolver(new OsgiComponentResolver(bundleContext));
        return context;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.