Package org.apache.camel

Examples of org.apache.camel.CamelContextAware


    }
   
   
    protected boolean canSetCamelContext(Object bean, String beanName) {
        if (bean instanceof CamelContextAware) {
            CamelContextAware camelContextAware = (CamelContextAware) bean;
            CamelContext context = camelContextAware.getCamelContext();
            if (context != null) {
                if (LOG.isTraceEnabled()) {
                    LOG.trace("CamelContext already set on bean with id [" + beanName + "]. Will keep existing CamelContext on bean.");
                }
                return false;
View Full Code Here


            answer = new DefaultManagementStrategy();
        }

        // inject CamelContext
        if (answer instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) answer;
            aware.setCamelContext(this);
        }

        return answer;
    }
View Full Code Here

        context.getManagementStrategy().setStatisticsLevel(level);
    }
   
    private static void configureCamelContextAware(CamelContext context, Object value) throws Exception {
        Class<?> contextAwareClass = Classes.forName(value.toString());
        CamelContextAware contextAware = (CamelContextAware)contextAwareClass.newInstance();
        contextAware.setCamelContext(context);
    }
View Full Code Here

    public void addService(Object object) throws Exception {

        // inject CamelContext
        if (object instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) object;
            aware.setCamelContext(this);
        }

        if (object instanceof Service) {
            Service service = (Service) object;
View Full Code Here

            answer = new DefaultManagementStrategy();
        }

        // inject CamelContext
        if (answer instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) answer;
            aware.setCamelContext(this);
        }

        return answer;
    }
View Full Code Here

    }

    private void doAddService(Object object, boolean closeOnShutdown) throws Exception {
        // inject CamelContext
        if (object instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) object;
            aware.setCamelContext(this);
        }

        if (object instanceof Service) {
            Service service = (Service) object;
View Full Code Here

            setCamelContext((SpringCamelContext) applicationContext.getBean(camelId));
        }
        injectFields(bean);
        injectMethods(bean);
        if (bean instanceof CamelContextAware && canSetCamelContext(bean, beanName)) {
            CamelContextAware contextAware = (CamelContextAware)bean;
            if (camelContext == null) {
                LOG.warn("No CamelContext defined yet so cannot inject into: " + bean);
            } else {
                contextAware.setCamelContext(camelContext);
            }
        }
        return bean;
    }
View Full Code Here

    }

    private void doAddService(Object object, boolean closeOnShutdown) throws Exception {
        // inject CamelContext
        if (object instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) object;
            aware.setCamelContext(this);
        }

        if (object instanceof Service) {
            Service service = (Service) object;
View Full Code Here

            setCamelContext((CamelContext) applicationContext.getBean(camelId));
        }
        injectFields(bean);
        injectMethods(bean);
        if (bean instanceof CamelContextAware) {
            CamelContextAware contextAware = (CamelContextAware)bean;
            if (camelContext == null) {
                LOG.warn("No CamelContext defined yet so cannot inject into: " + bean);
            } else {
                contextAware.setCamelContext(camelContext);
            }
        }
        return bean;
    }
View Full Code Here

    }

    private void doAddService(Object object, boolean closeOnShutdown) throws Exception {
        // inject CamelContext
        if (object instanceof CamelContextAware) {
            CamelContextAware aware = (CamelContextAware) object;
            aware.setCamelContext(this);
        }

        if (object instanceof Service) {
            Service service = (Service) object;
View Full Code Here

TOP

Related Classes of org.apache.camel.CamelContextAware

Copyright © 2018 www.massapicom. 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.