Class BaseServiceImplementation


  • public class BaseServiceImplementation
    extends Object
    Support for services which require a ReviewDb instance.
    • Constructor Detail

      • BaseServiceImplementation

        protected BaseServiceImplementation​(com.google.inject.Provider<ReviewDb> schema,
                                            com.google.inject.Provider<? extends CurrentUser> currentUser)
    • Method Detail

      • getAccountId

        protected Account.Id getAccountId()
      • run

        protected <T> void run​(com.google.gwtjsonrpc.common.AsyncCallback<T> callback,
                               BaseServiceImplementation.Action<T> action)
        Executes action.run with an active ReviewDb connection.

        A database handle is automatically opened and closed around the action's BaseServiceImplementation.Action.run(ReviewDb) method. OrmExceptions are caught and passed into the onFailure method of the callback.

        Type Parameters:
        T - type of result the callback expects.
        Parameters:
        callback - the callback that will receive the result.
        action - the action logic to perform.