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      /**
16       * Execute a method that uses the <code>connection</code> passed.
17       * <p/>
18       * See {@link com.atlassian.sal.api.rdbms.TransactionalExecutor} for allowed actions.
19       *
20       * @param connection guaranteed to be provided
21       * @return optional, may be {@link java.lang.Void}
22       */
23      A execute(Connection connection);
24  }