/** * 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.spring; import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionException; import org.springframework.transaction.TransactionStatus; public class NoopPlatformTransactionManager implements PlatformTransactionManager { @Override public TransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException { return new StubTransactionStatus(); } @Override public void commit(TransactionStatus status) throws TransactionException { // empty } @Override public void rollback(TransactionStatus status) throws TransactionException { // empty } protected static class StubTransactionStatus implements TransactionStatus { @Override public boolean isNewTransaction() { return false; } @Override public boolean hasSavepoint() { return false; } @Override public void setRollbackOnly() { // empty } @Override public boolean isRollbackOnly() { return false; } @Override public void flush() { // empty } @Override public boolean isCompleted() { return false; } @Override public Object createSavepoint() throws TransactionException { return null; } @Override public void rollbackToSavepoint(Object savepoint) throws TransactionException { // empty } @Override public void releaseSavepoint(Object savepoint) throws TransactionException { // empty } } }