Class BambooSpringUtils

java.lang.Object
com.atlassian.bamboo.util.BambooSpringUtils

public class BambooSpringUtils extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    autowireComponent(@NotNull org.springframework.beans.factory.config.AutowireCapableBeanFactory beanFactory, T o)
    Autowires the supplied objects and returns it for easy chaining.
    static <T> T
    Autowires the supplied objects and returns it for easy chaining.
    static @NotNull org.springframework.transaction.support.TransactionTemplate
    clone(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @Nullable Boolean requiresNewTx, @Nullable Boolean readOnly)
    Clones the supplied template, with the supplied parameters modified (or kept as-is, if null)
    static <T> T
    createCompleteComponent(@NotNull Class<T> objectClass)
    Creates a new Spring bean of the given class.
    static @NotNull org.springframework.transaction.support.TransactionTemplate
    readOnly(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
    If the supplied template creates readonly transactions, returns it.
    static @NotNull org.springframework.transaction.support.TransactionTemplate
    readOnlyClone(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
    Clones the supplied template.
    static @NotNull org.springframework.transaction.support.TransactionTemplate
    requiresNew(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
    If the supplied template creates is set to REQUIRES_NEW, returns it.
    static @NotNull org.springframework.transaction.support.TransactionTemplate
    requiresNewClone(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
    Clones the supplied template.
    static Object
    unwrapIfProxy(@NotNull Object bean)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • readOnly

      @NotNull public static @NotNull org.springframework.transaction.support.TransactionTemplate readOnly(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
      If the supplied template creates readonly transactions, returns it. Otherwise, clones the supplied template. The clone will produce read-only transactions.
    • readOnlyClone

      @NotNull public static @NotNull org.springframework.transaction.support.TransactionTemplate readOnlyClone(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
      Clones the supplied template. The clone will produce read-only transactions.
    • requiresNew

      @NotNull public static @NotNull org.springframework.transaction.support.TransactionTemplate requiresNew(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
      If the supplied template creates is set to REQUIRES_NEW, returns it. Otherwise, clones the supplied template. The clone will produce new transactions each time it's used.
    • requiresNewClone

      @NotNull public static @NotNull org.springframework.transaction.support.TransactionTemplate requiresNewClone(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate)
      Clones the supplied template. The clone will produce new transactions each time it's used.
    • clone

      @NotNull public static @NotNull org.springframework.transaction.support.TransactionTemplate clone(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @Nullable @Nullable Boolean requiresNewTx, @Nullable @Nullable Boolean readOnly)
      Clones the supplied template, with the supplied parameters modified (or kept as-is, if null)
    • unwrapIfProxy

      public static Object unwrapIfProxy(@NotNull @NotNull Object bean) throws Exception
      Throws:
      Exception
    • autowireComponent

      public static <T> T autowireComponent(T object)
      Autowires the supplied objects and returns it for easy chaining.
    • autowireComponent

      public static <T> T autowireComponent(@NotNull @NotNull org.springframework.beans.factory.config.AutowireCapableBeanFactory beanFactory, @NotNull T o)
      Autowires the supplied objects and returns it for easy chaining.
    • createCompleteComponent

      @NotNull public static <T> T createCompleteComponent(@NotNull @NotNull Class<T> objectClass)
      Creates a new Spring bean of the given class. The new instance is fully initialized - all it's dependencies are properly injected (all lifecycle processes are executed during object creation).
      Type Parameters:
      T - type of the component
      Parameters:
      objectClass - class of the object to be created as a Spring component
      Returns:
      new instance of the component