1 package com.atlassian.sal.api.transaction;
2
3 /**
4 * This allows applications greater control over the transaction in which operations may be executed.
5 * This really mimicks {@link org.springframework.transaction.support.TransactionTemplate}, however
6 * since JIRA doesn't know about Spring and doesn't support transactions we need to have our own implementation
7 * of this interface here.
8 *
9 * @since 2.0
10 */
11 public interface TransactionTemplate {
12 /**
13 * Executes the callback, returning the object returned. Any runtime exceptions thrown by the callback are assumed
14 * to rollback the transaction.
15 *
16 * @param action The callback
17 * @return The object returned from the callback
18 */
19 <T> T execute(TransactionCallback<T> action);
20 }