Package org.apache.camel

Examples of org.apache.camel.ExpressionEvaluationException


            }
        };
    }

    public List<String> splitMe(Exchange exchange) throws ExpressionEvaluationException {
        throw new ExpressionEvaluationException(null, exchange, null);
    }
View Full Code Here


        try {
            template.sendBody("direct:d", "World");
            fail("Should have thrown exception");
        } catch (CamelExecutionException e) {
            ExpressionEvaluationException cause = assertIsInstanceOf(ExpressionEvaluationException.class, e.getCause());
            assertTrue(cause.getCause().getMessage().startsWith("Unknown function: xxx at location 0"));
        }

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    public <T> T evaluate(Exchange exchange, Class<T> tClass) {
        try {
            Object value = org.mvel2.MVEL.executeExpression(compiled, new RootObject(exchange));
            return exchange.getContext().getTypeConverter().convertTo(tClass, value);
        } catch (Exception e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

    public Object evaluate(Exchange exchange) {
        try {
            return org.mvel2.MVEL.executeExpression(compiled, new RootObject(exchange));
        } catch (Exception e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

            JXPathContext context = JXPathContext.newContext(exchange);
            Object result = getJXPathExpression().getValue(context, type);
            assertResultType(exchange, result);
            return exchange.getContext().getTypeConverter().convertTo(tClass, result);
        } catch (JXPathException e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

    private static class MyExpression implements Expression {

        public <T> T evaluate(Exchange exchange, Class<T> type) {
            // force an exception early, to test that the onException error handlers
            // can kick in anyway
            throw new ExpressionEvaluationException(null, exchange, null);
        }
View Full Code Here

            JXPathContext context = JXPathContext.newContext(exchange);
            Object result = getJXPathExpression().getValue(context, type);
            assertResultType(exchange, result);
            return exchange.getContext().getTypeConverter().convertTo(tClass, result);
        } catch (JXPathException e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

        OgnlContext oglContext = new OgnlContext();
        try {
            Object value = Ognl.getValue(expression, oglContext, new RootObject(exchange));
            return exchange.getContext().getTypeConverter().convertTo(tClass, value);
        } catch (OgnlException e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

            context.setLenient(lenient);
            Object result = getJXPathExpression().getValue(context, type);
            assertResultType(exchange, result);
            return exchange.getContext().getTypeConverter().convertTo(tClass, result);
        } catch (JXPathException e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

            EvaluationContext evaluationContext = createEvaluationContext(exchange);
            Object value = expression.getValue(evaluationContext);
            // Let Camel handle the type conversion
            return exchange.getContext().getTypeConverter().convertTo(tClass, value);
        } catch (Exception e) {
            throw new ExpressionEvaluationException(this, exchange, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.ExpressionEvaluationException

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.