Package org.apache.camel

Examples of org.apache.camel.NoSuchBeanException


    @Override
    protected Object lookupBean() throws NoSuchBeanException {
        try {
            return registry.lookup(getName());
        } catch (NotBoundException e) {
            throw new NoSuchBeanException(getName(), e);
        } catch (AccessException e) {
            throw new RuntimeCamelException(e);
        } catch (RemoteException e) {
            throw new RuntimeCamelException(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

        });
        try {
            context.start();
            fail("Should have thrown an exception");
        } catch (FailedToCreateRouteException e) {
            NoSuchBeanException cause = assertIsInstanceOf(NoSuchBeanException.class, e.getCause());
            assertEquals("No bean could be found in the registry of type: PlatformTransactionManager", cause.getMessage());
        }
    }
View Full Code Here

        try {
            super.setUp();
            fail("Should have thrown exception");
        } catch (RuntimeCamelException e) {
            FailedToCreateRouteException cause = assertIsInstanceOf(FailedToCreateRouteException.class, e.getCause());
            NoSuchBeanException nsbe = assertIsInstanceOf(NoSuchBeanException.class, cause.getCause());
            assertEquals("No bean could be found in the registry for: bar of type: org.apache.camel.builder.ErrorHandlerBuilder", nsbe.getMessage());
        }
    }
View Full Code Here

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

        try {
            super.setUp();
            fail("Should have thrown an exception");
        } catch (RuntimeCamelException e) {
            FailedToCreateRouteException cause = assertIsInstanceOf(FailedToCreateRouteException.class, e.getCause());
            NoSuchBeanException nsbe = assertIsInstanceOf(NoSuchBeanException.class, cause.getCause());
            assertEquals("No bean could be found in the registry for: foo of type: org.apache.camel.builder.ErrorHandlerBuilder", nsbe.getMessage());
        }
    }
View Full Code Here

    @Override
    protected Object lookupBean() throws NoSuchBeanException {
        try {
            return registry.lookup(getName());
        } catch (NotBoundException e) {
            throw new NoSuchBeanException(getName(), e);
        } catch (AccessException e) {
            throw new RuntimeCamelException(e);
        } catch (RemoteException e) {
            throw new RuntimeCamelException(e);
        }
View Full Code Here

            if (answer == null) {
                // then create a thread pool assuming the ref is a thread pool profile id
                answer = manager.newThreadPool(definition, name, definition.getExecutorServiceRef());
            }
            if (answer == null) {
                throw new NoSuchBeanException(definition.getExecutorServiceRef(), "ExecutorService");
            }
            return answer;
        }

        return null;
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.