Package org.apache.camel.spi

Examples of org.apache.camel.spi.LanguageResolver


            this.name = name;
            this.path = path;
        }

        public Language resolveLanguage(String name, CamelContext context) {
            LanguageResolver resolver = createInstance(this.name, path, context);
            return resolver.resolveLanguage(name, context);
        }
View Full Code Here


        }
        Language lang = getLanguage(name, context);
        if (lang != null) {
            return lang;
        }
        LanguageResolver resolver = getLanguageResolver("default", context);
        if (resolver != null) {
            return resolver.resolveLanguage(name, context);
        }
        throw new NoSuchLanguageException(name);
    }
View Full Code Here

    protected Language getLanguage(String name, CamelContext context) {
        LOG.trace("Finding Language: {}", name);
        try {
            ServiceReference[] refs = bundleContext.getServiceReferences(LanguageResolver.class.getName(), "(language=" + name + ")");
            if (refs != null && refs.length > 0) {
                LanguageResolver resolver = (LanguageResolver) bundleContext.getService(refs[0]);
                return resolver.resolveLanguage(name, context);
            }
            return null;
        } catch (InvalidSyntaxException e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
        }
View Full Code Here

    protected LanguageResolver getLanguageResolver(String name, CamelContext context) {
        LOG.trace("Finding LanguageResolver: {}", name);
        try {
            ServiceReference[] refs = bundleContext.getServiceReferences(LanguageResolver.class.getName(), "(resolver=" + name + ")");
            if (refs != null && refs.length > 0) {
                LanguageResolver resolver = (LanguageResolver) bundleContext.getService(refs[0]);
                return resolver;
            }
            return null;
        } catch (InvalidSyntaxException e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
View Full Code Here

            this.name = name;
            this.path = path;
        }

        public Language resolveLanguage(String name, CamelContext context) {
            LanguageResolver resolver = createInstance(this.name, path, context);
            return resolver.resolveLanguage(name, context);
        }
View Full Code Here

        }
        Language lang = getLanguage(name, context);
        if (lang != null) {
            return lang;
        }
        LanguageResolver resolver = getLanguageResolver("default", context);
        if (resolver != null) {
            return resolver.resolveLanguage(name, context);
        }
        throw new NoSuchLanguageException(name);
    }
View Full Code Here

            ServiceReference<?>[] refs = bundleContext.getServiceReferences(LanguageResolver.class.getName(), "(language=" + name + ")");
            if (refs != null) {
                for (ServiceReference<?> ref : refs) {
                    Object service = bundleContext.getService(ref);
                    if (LanguageResolver.class.isAssignableFrom(service.getClass())) {
                        LanguageResolver resolver = (LanguageResolver) service;
                        return resolver.resolveLanguage(name, context);
                    }
                }
            }

            return null;
View Full Code Here

            ServiceReference<?>[] refs = bundleContext.getServiceReferences(LanguageResolver.class.getName(), "(resolver=" + name + ")");
            if (refs != null) {
                for (ServiceReference<?> ref : refs) {
                    Object service = bundleContext.getService(ref);
                    if (LanguageResolver.class.isAssignableFrom(service.getClass())) {
                        LanguageResolver resolver = (LanguageResolver) service;
                        return resolver;
                    }
                }
            }
            return null;
View Full Code Here

                    }
                    return null;
                }
            };
        } 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;
View Full Code Here

        }
        Language lang = getLanguage(name, context);
        if (lang != null) {
            return lang;
        }
        LanguageResolver resolver = getLanguageResolver("default", context);
        if (resolver != null) {
            return resolver.resolveLanguage(name, context);
        }
        throw new NoSuchLanguageException(name);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.LanguageResolver

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.