Package com.atlassian.bamboo.plan.cache
Class CacheLoadContextSupport
- java.lang.Object
-
- com.atlassian.bamboo.plan.cache.CacheLoadContextSupport
-
public class CacheLoadContextSupport extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.springframework.orm.hibernate5.HibernateTemplate
getHibernateTemplate()
static boolean
isInCacheLoadContext()
static <V> V
load(@NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull org.hibernate.SessionFactory sessionFactory, @NotNull Callable<V> callable)
This method will mark the current thread as being in cache load context (seeisInCacheLoadContext()
and executes the supplied callback within a transaction retrieved from transactionTemplate.
-
-
-
Method Detail
-
isInCacheLoadContext
public static boolean isInCacheLoadContext()
-
getHibernateTemplate
public static org.springframework.orm.hibernate5.HibernateTemplate getHibernateTemplate()
-
load
public static <V> V load(@NotNull @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull @NotNull org.hibernate.SessionFactory sessionFactory, @NotNull @NotNull Callable<V> callable)
This method will mark the current thread as being in cache load context (seeisInCacheLoadContext()
and executes the supplied callback within a transaction retrieved from transactionTemplate. It also sets up a new HibernateTemplate, made available viagetHibernateTemplate()
-
-