Examples of resolveDataFormat()


Examples of org.apache.camel.CamelContext.resolveDataFormat()

        // setup json data format
        String name = context.getRestConfiguration().getJsonDataFormat();
        if (name == null) {
            name = "json-jackson";
        }
        DataFormat json = context.resolveDataFormat(name);
        DataFormat outJson = context.resolveDataFormat(name);

        // is json binding required?
        if (mode.contains("json") && json == null) {
            throw new IllegalArgumentException("JSon DataFormat " + name + " not found.");
View Full Code Here

Examples of org.apache.camel.CamelContext.resolveDataFormat()

        String name = context.getRestConfiguration().getJsonDataFormat();
        if (name == null) {
            name = "json-jackson";
        }
        DataFormat json = context.resolveDataFormat(name);
        DataFormat outJson = context.resolveDataFormat(name);

        // is json binding required?
        if (mode.contains("json") && json == null) {
            throw new IllegalArgumentException("JSon DataFormat " + name + " not found.");
        }
View Full Code Here

Examples of org.apache.camel.CamelContext.resolveDataFormat()

        // setup xml data format
        name = context.getRestConfiguration().getXmlDataFormat();
        if (name == null) {
            name = "jaxb";
        }
        DataFormat jaxb = context.resolveDataFormat(name);
        DataFormat outJaxb = context.resolveDataFormat(name);
        // is xml binding required?
        if (mode.contains("xml") && jaxb == null) {
            throw new IllegalArgumentException("XML DataFormat " + name + " not found.");
        }
View Full Code Here

Examples of org.apache.camel.CamelContext.resolveDataFormat()

        name = context.getRestConfiguration().getXmlDataFormat();
        if (name == null) {
            name = "jaxb";
        }
        DataFormat jaxb = context.resolveDataFormat(name);
        DataFormat outJaxb = context.resolveDataFormat(name);
        // is xml binding required?
        if (mode.contains("xml") && jaxb == null) {
            throw new IllegalArgumentException("XML DataFormat " + name + " not found.");
        }
View Full Code Here

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

        LOG.trace("Finding DataFormat: " + name);
        try {
            ServiceReference[] refs = bundleContext.getServiceReferences(DataFormatResolver.class.getName(), "(dataformat=" + name + ")");
            if (refs != null && refs.length > 0) {
                DataFormatResolver resolver = (DataFormatResolver) bundleContext.getService(refs[0]);
                return resolver.resolveDataFormat(name, context);
            }
            return null;
        } catch (InvalidSyntaxException e) {
            throw new RuntimeException(e); // Should never happen
        }
View Full Code Here

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

        }
        try {
            ServiceReference[] refs = bundleContext.getServiceReferences(DataFormatResolver.class.getName(), "(dataformat=" + name + ")");
            if (refs != null && refs.length > 0) {
                DataFormatResolver resolver = (DataFormatResolver) bundleContext.getService(refs[0]);
                return resolver.resolveDataFormat(name, context);
            }
            return null;
        } catch (InvalidSyntaxException e) {
            throw ObjectHelper.wrapRuntimeCamelException(e);
        }
View Full Code Here

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

            if (refs != null) {
                for (ServiceReference ref : refs) {
                    Object service = bundleContext.getService(ref);
                    if (DataFormatResolver.class.isAssignableFrom(service.getClass())) {
                        DataFormatResolver resolver = (DataFormatResolver) service;
                        return resolver.resolveDataFormat(name, context);
                    }
                }
            }
            return null;
        } catch (InvalidSyntaxException e) {
View Full Code Here

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

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

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

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

Examples of org.apache.camel.spi.DataFormatResolver.resolveDataFormat()

            if (refs != null) {
                for (ServiceReference<?> ref : refs) {
                    Object service = bundleContext.getService(ref);
                    if (DataFormatResolver.class.isAssignableFrom(service.getClass())) {
                        DataFormatResolver resolver = (DataFormatResolver) service;
                        return resolver.resolveDataFormat(name, context);
                    }
                }
            }
            return null;
        } catch (InvalidSyntaxException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.