Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.impl.engine;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;
import org.apache.camel.AsyncCallback;
import org.apache.camel.Exchange;
import org.apache.camel.ExtendedCamelContext;
import org.apache.camel.ExtendedExchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.apache.camel.Route;
import org.apache.camel.Service;
import org.apache.camel.spi.InflightRepository;
import org.apache.camel.spi.Synchronization;
import org.apache.camel.spi.SynchronizationVetoable;
import org.apache.camel.spi.UnitOfWork;
import org.apache.camel.support.DefaultMessage;
import org.apache.camel.support.EventHelper;
import org.apache.camel.support.MessageSupport;
import org.apache.camel.support.UnitOfWorkHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The default implementation of {@link org.apache.camel.spi.UnitOfWork}
*/
public class DefaultUnitOfWork implements UnitOfWork, Service {
private static final Logger LOG = LoggerFactory.getLogger(DefaultUnitOfWork.class);
final InflightRepository inflightRepository;
final boolean allowUseOriginalMessage;
final boolean useBreadcrumb;
// TODO: This implementation seems to have transformed itself into a to broad concern
// where unit of work is doing a bit more work than the transactional aspect that ties
// to its name. Maybe this implementation should be named ExchangeContext and we can
// introduce a simpler UnitOfWork concept. This would also allow us to refactor the
// SubUnitOfWork into a general parent/child unit of work concept. However this
// requires API changes and thus is best kept for future Camel work
private final Deque routes = new ArrayDeque<>(8);
private final Exchange exchange;
private final ExtendedCamelContext context;
private Logger log;
private List synchronizations;
private Message originalInMessage;
private Set