View Javadoc

1   package com.atlassian.sal.api.rdbms;
2   
3   import com.atlassian.annotations.PublicApi;
4   
5   import java.sql.Connection;
6   
7   /**
8    * Callback to be executed by {@link com.atlassian.sal.api.rdbms.TransactionalExecutor#execute(ConnectionCallback)}
9    *
10   * @since 3.0
11   */
12  @PublicApi
13  public interface ConnectionCallback<A> {
14      /**
15       * Execute a method that uses the <code>connection</code> passed.
16       * <p/>
17       * See {@link com.atlassian.sal.api.rdbms.TransactionalExecutor} for allowed actions.
18       *
19       * @param connection guaranteed to be provided
20       * @return optional, may be {@link java.lang.Void}
21       */
22      A execute(Connection connection);
23  }