001/* 002 * Copyright 2002-2012 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * https://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.transaction.support; 018 019import org.springframework.core.Ordered; 020 021/** 022 * Simple {@link TransactionSynchronization} adapter containing empty 023 * method implementations, for easier overriding of single methods. 024 * 025 * <p>Also implements the {@link Ordered} interface to enable the execution 026 * order of synchronizations to be controlled declaratively. The default 027 * {@link #getOrder() order} is {@link Ordered#LOWEST_PRECEDENCE}, indicating 028 * late execution; return a lower value for earlier execution. 029 * 030 * @author Juergen Hoeller 031 * @since 22.01.2004 032 */ 033public abstract class TransactionSynchronizationAdapter implements TransactionSynchronization, Ordered { 034 035 @Override 036 public int getOrder() { 037 return Ordered.LOWEST_PRECEDENCE; 038 } 039 040 @Override 041 public void suspend() { 042 } 043 044 @Override 045 public void resume() { 046 } 047 048 @Override 049 public void flush() { 050 } 051 052 @Override 053 public void beforeCommit(boolean readOnly) { 054 } 055 056 @Override 057 public void beforeCompletion() { 058 } 059 060 @Override 061 public void afterCommit() { 062 } 063 064 @Override 065 public void afterCompletion(int status) { 066 } 067 068}