Package org.apache.camel.language.simple

Examples of org.apache.camel.language.simple.SimpleLanguage


public class JndiRegistryTest extends TestCase {

    public void testLookupByType() throws Exception {
        JndiRegistry jndi = new JndiRegistry(JndiTest.createInitialContext());
        jndi.bind("foo", new SimpleLanguage());
        jndi.bind("bar", "Hello bar");

        assertEquals("Hello bar", jndi.lookup("bar"));
        assertEquals("Hello bar", jndi.lookupByName("bar"));
        assertEquals("Hello bar", jndi.lookupByNameAndType("bar", String.class));
View Full Code Here


            };
        } else if (classNames[0].equals(LanguageResolver.class.getName())) {
            return new LanguageResolver() {
                public Language resolveLanguage(String name, CamelContext context) {
                    if (name.equals("simple")) {
                        return new SimpleLanguage();
                    }
                    return null;
                }
            };
        } else {
View Full Code Here

        }
        return expression.evaluate(exchange, type);
    }

    private Predicate createPredicate(Exchange exchange) {
        SimpleLanguage simple = (SimpleLanguage) exchange.getContext().resolveLanguage("simple");
        // resolve property placeholders
        try {
            String resolve = exchange.getContext().resolvePropertyPlaceholders(text);
            return simple.createPredicate(resolve);
        } catch (Exception e) {
            throw ObjectHelper.wrapCamelExecutionException(exchange, e);
        }
    }
View Full Code Here

            throw ObjectHelper.wrapCamelExecutionException(exchange, e);
        }
    }

    private Expression createExpression(Exchange exchange) {
        SimpleLanguage simple = (SimpleLanguage) exchange.getContext().resolveLanguage("simple");
        // resolve property placeholders
        try {
            String resolve = exchange.getContext().resolvePropertyPlaceholders(text);
            return simple.createExpression(resolve, resultType);
        } catch (Exception e) {
            throw ObjectHelper.wrapCamelExecutionException(exchange, e);
        }
    }
View Full Code Here

            };
        } else if (classNames[0].equals(LanguageResolver.class.getName())) {
            return new LanguageResolver() {
                public Language resolveLanguage(String name, CamelContext context) {
                    if (name.equals("simple")) {
                        return new SimpleLanguage();
                    }
                    return null;
                }
            };
        } else {
View Full Code Here

TOP

Related Classes of org.apache.camel.language.simple.SimpleLanguage

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.