public final class FinderSupport extends java.lang.Object
Shared session-execution helper for the synchronous finder implementations in this package.
Not a base class - each finder holds a DatastoreResolver field and calls these
statically, rather than inheriting an execute method. The datastore is resolved on
every call, so a finder built from a lazy resolver follows whatever datastore the resolver
returns at invocation time.
| Type Params | Return Type | Name and description |
|---|---|---|
<T> |
public static T |
execute(DatastoreResolver datastoreResolver, SessionCallback<T> callback)Executes the given callback within a session bound to the datastore the resolver returns. |
|
public static void |
execute(DatastoreResolver datastoreResolver, VoidSessionCallback callback)Executes the given void callback within a session bound to the datastore the resolver returns. |
|
public static DatastoreResolver |
resolverFor(Datastore datastore)Wraps a fixed datastore as a resolver. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Executes the given callback within a session bound to the datastore the resolver returns.
datastoreResolver - The datastore resolver, or null for stateless modecallback - The callbackT - The callback's result typeExecutes the given void callback within a session bound to the datastore the resolver returns.
datastoreResolver - The datastore resolver, or null for stateless modecallback - The callbackWraps a fixed datastore as a resolver.
datastore - The datastore, or null for stateless mode