Package org.apache.camel.spi

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


            @Override
            public void configure() throws Exception {
                // START SNIPPET: e1
                // just a unit test but imaging using your own data format that does complex
                // and CPU heavy processing for decrypting the message
                DataFormat mySecureDataFormat = new StringDataFormat("iso-8859-1");

                // list on the JMS queue for new orders
                from("jms:queue:order")
                    // do some sanity check validation
                    .to("bean:validateOrder")
View Full Code Here

            @Override
            public void configure() throws Exception {
                // START SNIPPET: e1
                // just a unit test but imaging using your own data format that does complex
                // and CPU heavy processing for decrypting the message
                DataFormat mySecureDataFormat = new StringDataFormat("iso-8859-1");

                // list on the JMS queue for new orders
                from("jms:queue:order")
                    // do some sanity check validation
                    .to("bean:validateOrder")
View Full Code Here

                errorHandler(deadLetterChannel("jms:queue:error").redeliveryDelay(0));

                onException(InvalidOrderException.class).maximumRedeliveries(0).handled(true)
                    .to("jms:queue:invalid");

                DataFormat jaxb = new JaxbDataFormat("org.apache.camel.itest.jms");

                from("jms:queue:in")
                    .unmarshal(jaxb)
                    .choice()
                        .when().method(JmsJaxbTest.class, "isWine").to("jms:queue:wine")
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() throws Exception {
                // START SNIPPET: e1
                DataFormat hl7 = new HL7DataFormat();
                // we setup or HL7 listener on port 8888 (using the hl7codec) and in sync mode so we can return a response
                from("mina:tcp://127.0.0.1:8888?sync=true&codec=#hl7codec")
                    // we use the HL7 data format to unmarshal from HL7 stream to the HAPI Message model
                    // this ensures that the camel message has been enriched with hl7 specific headers to
                    // make the routing much easier (see below)
View Full Code Here

            if (type != null) {
                return type.getDataFormat(routeContext);
            }

            DataFormat dataFormat = routeContext.getCamelContext().resolveDataFormat(ref);
            if (dataFormat == null) {
                throw new IllegalArgumentException("Cannot find data format in registry with ref: " + ref);
            }

            return dataFormat;
View Full Code Here

    public static final String DATAFORMAT_RESOURCE_PATH = "META-INF/services/org/apache/camel/dataformat/";

    protected FactoryFinder dataformatFactory;

    public DataFormat resolveDataFormat(String name, CamelContext context) {
        DataFormat dataFormat = lookup(context, name, DataFormat.class);
        if (dataFormat == null) {
            Class<?> type = null;
            try {
                if (dataformatFactory == null) {
                    dataformatFactory = context.getFactoryFinder(DATAFORMAT_RESOURCE_PATH);
View Full Code Here

        this.dataFormatType = dataFormatType;
    }

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

    @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

        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

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

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.