Modifier and Type | Class and Description |
---|---|
static interface |
BaseServiceImplementation.Action<T>
Arbitrary action to run with a database connection.
|
static class |
BaseServiceImplementation.Failure
Exception whose cause is passed into onFailure.
|
Modifier | Constructor and Description |
---|---|
protected |
BaseServiceImplementation(com.google.inject.Provider<ReviewDb> schema,
com.google.inject.Provider<? extends CurrentUser> currentUser) |
Modifier and Type | Method and Description |
---|---|
protected Account.Id |
getAccountId() |
protected ReviewDb |
getDb() |
protected CurrentUser |
getUser() |
protected <T> void |
run(com.google.gwtjsonrpc.common.AsyncCallback<T> callback,
BaseServiceImplementation.Action<T> action)
Executes
action.run with an active ReviewDb connection. |
protected BaseServiceImplementation(com.google.inject.Provider<ReviewDb> schema, com.google.inject.Provider<? extends CurrentUser> currentUser)
protected Account.Id getAccountId()
protected CurrentUser getUser()
protected ReviewDb getDb()
protected <T> void run(com.google.gwtjsonrpc.common.AsyncCallback<T> callback, BaseServiceImplementation.Action<T> action)
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.
T
- type of result the callback expects.callback
- the callback that will receive the result.action
- the action logic to perform.