Examples of DataFormat


Examples of org.apache.camel.spi.DataFormat

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
            public void configure() {
                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.example");

                // use seda that supports concurrent consumers for concurrency
                from("seda:start?size=" + size + "&concurrentConsumers=5")
                        .marshal(jaxb)
                        .convertBodyTo(String.class)
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new MarshalProcessor(dataFormat);
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new UnmarshalProcessor(dataFormat);
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.strategyRef = strategyRef;
    }

    @Override
    protected DataFormat createDataFormat(RouteContext routeContext) {
        DataFormat csvFormat = super.createDataFormat(routeContext);

        if (ObjectHelper.isNotEmpty(configRef)) {
            Object config = CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), configRef);
            setProperty(csvFormat, "config", config);
        }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

    @Override
    protected DataFormat createDataFormat(RouteContext routeContext) {
        if ("json".equals(this.driver)) {
            setProperty(this, "dataFormatName", "json-xstream");
        }
        DataFormat answer = super.createDataFormat(routeContext);
        // need to lookup the reference for the xstreamDriver
        if (ObjectHelper.isNotEmpty(driverRef)) {
            setProperty(answer, "xstreamDriver", CamelContextHelper.mandatoryLookup(routeContext.getCamelContext(), driverRef));
        }
        return answer;
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

    public boolean isUseRouteBuilder() {
        return false;
    }

    public void testMarshalMandatoryConversionFailed() throws Exception {
        DataFormat dataFormat = new ZipDataFormat();

        try {
            dataFormat.marshal(new DefaultExchange(new DefaultCamelContext()), new Object(), new ByteArrayOutputStream());
            fail("Should have thrown an exception");
        } catch (NoTypeConversionAvailableException e) {
            // expected
        }
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new MarshalProcessor(dataFormat);
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new UnmarshalProcessor(dataFormat);
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new UnmarshalProcessor(dataFormat);
    }
View Full Code Here

Examples of org.apache.camel.spi.DataFormat

        this.dataFormatType = dataFormatType;
    }

    @Override
    public Processor createProcessor(RouteContext routeContext) {
        DataFormat dataFormat = DataFormatDefinition.getDataFormat(routeContext, getDataFormatType(), ref);
        return new MarshalProcessor(dataFormat);
    }
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.