Package org.apache.camel

Examples of org.apache.camel.NoSuchBeanException


        try {
            return type.cast(answer);
        } catch (Throwable e) {
            String msg = "Found bean: " + name + " in JNDI Context: " + context
                    + " of type: " + answer.getClass().getName() + " expected type was: " + type;
            throw new NoSuchBeanException(name, msg, e);
        }
    }
View Full Code Here


     * Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
     */
    public static Object lookupMandatoryBean(Exchange exchange, String name) {
        Object value = lookupBean(exchange, name);
        if (value == null) {
            throw new NoSuchBeanException(name);
        }
        return value;
    }
View Full Code Here

     * Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
     */
    public static <T> T lookupMandatoryBean(Exchange exchange, String name, Class<T> type) {
        T value = lookupBean(exchange, name, type);
        if (value == null) {
            throw new NoSuchBeanException(name);
        }
        return value;
    }
View Full Code Here

    }

    public Object getBean() throws NoSuchBeanException {
        Object value = lookupBean();
        if (value == null) {
            throw new NoSuchBeanException(name);
        }
        if (value != bean) {
            bean = value;
            processor = null;
            if (!ObjectHelper.equal(ObjectHelper.type(bean), ObjectHelper.type(value))) {
View Full Code Here

     * Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
     */
    public static Object lookupMandatoryBean(Exchange exchange, String name) {
        Object value = lookupBean(exchange, name);
        if (value == null) {
            throw new NoSuchBeanException(name);
        }
        return value;
    }
View Full Code Here

     * Performs a lookup in the registry of the mandatory bean name and throws an exception if it could not be found
     */
    public static <T> T lookupMandatoryBean(Exchange exchange, String name, Class<T> type) {
        T value = lookupBean(exchange, name, type);
        if (value == null) {
            throw new NoSuchBeanException(name);
        }
        return value;
    }
View Full Code Here

        try {
            context.start();
            fail("Should have thrown exception");
        } catch (FailedToCreateRouteException e) {
            assertEquals("b", e.getRouteId());
            NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.getCause());
            assertEquals("bar", cause.getName());
        }
    }
View Full Code Here

        try {
            context.start();
            fail("Should have thrown exception");
        } catch (FailedToCreateRouteException e) {
            assertEquals("b", e.getRouteId());
            NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.getCause());
            assertEquals("bar", cause.getName());
        }
    }
View Full Code Here

            } catch (Throwable e) {
                // do not double wrap the exception
                if (e instanceof NoSuchBeanException) {
                    ex = (NoSuchBeanException)e;
                } else {
                    ex = new NoSuchBeanException(name, "Cannot lookup: " + name + " from registry: " + registry
                        + " with expected type: " + type + " due: " + e.getMessage(), e);
                }
            }
            if (answer != null) {
                return answer;
View Full Code Here

        try {
            return type.cast(answer);
        } catch (Throwable e) {
            String msg = "Found bean: " + name + " in JNDI Context: " + context
                    + " of type: " + answer.getClass().getName() + " expected type was: " + type;
            throw new NoSuchBeanException(name, msg, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.NoSuchBeanException

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.