Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultUnitOfWork


        context.getProperties().put(CachedOutputStream.THRESHOLD, "16");
        deleteDirectory("./target/cachedir");
        createDirectory("./target/cachedir");

        exchange = new DefaultExchange(context);
        UnitOfWork uow = new DefaultUnitOfWork(exchange);
        exchange.setUnitOfWork(uow);
    }
View Full Code Here


        context.getProperties().put(CachedOutputStream.THRESHOLD, "16");
        deleteDirectory("./target/cachedir");
        createDirectory("./target/cachedir");

        exchange = new DefaultExchange(context);
        UnitOfWork uow = new DefaultUnitOfWork(exchange);
        exchange.setUnitOfWork(uow);
    }
View Full Code Here

        context.getProperties().put(CachedOutputStream.THRESHOLD, "16");
        deleteDirectory("./target/cachedir");
        createDirectory("./target/cachedir");

        exchange = new DefaultExchange(context);
        UnitOfWork uow = new DefaultUnitOfWork(exchange);
        exchange.setUnitOfWork(uow);
    }
View Full Code Here

        context.getProperties().put(CachedOutputStream.THRESHOLD, "16");
        deleteDirectory("./target/cachedir");
        createDirectory("./target/cachedir");

        exchange = new DefaultExchange(context);
        UnitOfWork uow = new DefaultUnitOfWork(exchange);
        exchange.setUnitOfWork(uow);
    }
View Full Code Here

    protected UnitOfWork createUnitOfWork(Exchange exchange) {
        UnitOfWork answer;
        if (exchange.getContext().isUseMDCLogging()) {
            answer = new MDCUnitOfWork(exchange);
        } else {
            answer = new DefaultUnitOfWork(exchange);
        }
        return answer;
    }
View Full Code Here

        context.getProperties().put(CachedOutputStream.THRESHOLD, "16");
        deleteDirectory("./target/cachedir");
        createDirectory("./target/cachedir");

        exchange = new DefaultExchange(context);
        UnitOfWork uow = new DefaultUnitOfWork(exchange);
        exchange.setUnitOfWork(uow);
    }
View Full Code Here

    @Override
    protected void processNext(Exchange exchange) throws Exception {
        if (exchange.getUnitOfWork() == null) {
            // If there is no existing UoW, then we should start one and
            // terminate it once processing is completed for the exchange.
            final DefaultUnitOfWork uow = new DefaultUnitOfWork(exchange);
            exchange.setUnitOfWork(uow);
            try {
                uow.start();
            } catch (Exception e) {
                throw wrapRuntimeCamelException(e);
            }

            // process the exchange
            try {
                processor.process(exchange);
            } catch (Exception e) {
                exchange.setException(e);
            }

            // unit of work is done
            exchange.getUnitOfWork().done(exchange);
            try {
                uow.stop();
            } catch (Exception e) {
                throw wrapRuntimeCamelException(e);
            }
            exchange.setUnitOfWork(null);
        } else {
View Full Code Here

        }

        if (exchange.getUnitOfWork() == null) {
            // If there is no existing UoW, then we should start one and
            // terminate it once processing is completed for the exchange.
            final DefaultUnitOfWork uow = new DefaultUnitOfWork(exchange);
            exchange.setUnitOfWork(uow);
            try {
                uow.start();
            } catch (Exception e) {
                callback.done(true);
                exchange.setException(e);
                return true;
            }
View Full Code Here

    protected UnitOfWork createUnitOfWork(Exchange exchange) {
        UnitOfWork answer;
        if (exchange.getContext().isUseMDCLogging()) {
            answer = new MDCUnitOfWork(exchange);
        } else {
            answer = new DefaultUnitOfWork(exchange);
        }
        return answer;
    }
View Full Code Here

    protected UnitOfWork createUnitOfWork(Exchange exchange) {
        UnitOfWork answer;
        if (exchange.getContext().isUseMDCLogging()) {
            answer = new MDCUnitOfWork(exchange);
        } else {
            answer = new DefaultUnitOfWork(exchange);
        }
        return answer;
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.DefaultUnitOfWork

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.