Enum Class SurroundingTransactionDetectorMethodInterceptor

java.lang.Object
java.lang.Enum<SurroundingTransactionDetectorMethodInterceptor>
org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor
All Implemented Interfaces:
Serializable, Comparable<SurroundingTransactionDetectorMethodInterceptor>, Constable, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public enum SurroundingTransactionDetectorMethodInterceptor extends Enum<SurroundingTransactionDetectorMethodInterceptor> implements org.aopalliance.intercept.MethodInterceptor
MethodInterceptor detecting whether a transaction is already running and exposing that fact via isSurroundingTransactionActive(). Useful in case subsequent interceptors might create transactions themselves but downstream components have to find out whether there was one running before the call entered the proxy.
Since:
1.13
Author:
Oliver Gierke, Christoph Strobl
  • Enum Constant Details

  • Method Details

    • values

      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSurroundingTransactionActive

      public boolean isSurroundingTransactionActive()
      Returns whether a transaction was active before the method call entered the repository proxy.
      Returns:
    • invoke

      @Nullable public Object invoke(org.aopalliance.intercept.MethodInvocation invocation) throws Throwable
      Specified by:
      invoke in interface org.aopalliance.intercept.MethodInterceptor
      Throws:
      Throwable