@InstallSubject(value="loadDelegate") public interface KeyValueInstanceLoader extends DataLoader
KeyValueEntity
.Modifier and Type | Interface and Description |
---|---|
static class |
KeyValueInstanceLoader.PostLoadEvent
Event sent after successful loading of a KeyValueEntity instance and setting it to
the container.
|
static class |
KeyValueInstanceLoader.PreLoadEvent
Event sent before loading a KeyValueEntity instance.
|
Modifier and Type | Method and Description |
---|---|
Subscription |
addPostLoadListener(java.util.function.Consumer<KeyValueInstanceLoader.PostLoadEvent> listener)
Adds a listener to
KeyValueInstanceLoader.PostLoadEvent . |
Subscription |
addPreLoadListener(java.util.function.Consumer<KeyValueInstanceLoader.PreLoadEvent> listener)
Adds a listener to
KeyValueInstanceLoader.PreLoadEvent . |
ValueLoadContext |
createLoadContext()
Returns
ValueLoadContext which is created by the parameters of this loader. |
KeyValueContainer |
getContainer()
Returns the container which accepts loaded entities.
|
java.util.function.Function<ValueLoadContext,KeyValueEntity> |
getLoadDelegate()
Returns a function which will be used to load data instead of standard implementation.
|
java.lang.String |
getStoreName()
Returns data store name.
|
void |
setContainer(KeyValueContainer container)
Sets the container which accepts loaded entities.
|
void |
setLoadDelegate(java.util.function.Function<ValueLoadContext,KeyValueEntity> delegate)
Sets a function which will be used to load data instead of standard implementation.
|
void |
setStoreName(java.lang.String name)
Sets the data store name.
|
getCondition, getDataContext, getParameter, getParameters, getQuery, isSoftDeletion, load, removeParameter, setCondition, setDataContext, setParameter, setParameters, setQuery, setSoftDeletion
KeyValueContainer getContainer()
getContainer
in interface DataLoader
void setContainer(KeyValueContainer container)
ValueLoadContext createLoadContext()
ValueLoadContext
which is created by the parameters of this loader. The ValueLoadContext
can be used with DataManager
to load data by the same conditions.java.lang.String getStoreName()
void setStoreName(java.lang.String name)
java.util.function.Function<ValueLoadContext,KeyValueEntity> getLoadDelegate()
void setLoadDelegate(java.util.function.Function<ValueLoadContext,KeyValueEntity> delegate)
Subscription addPreLoadListener(java.util.function.Consumer<KeyValueInstanceLoader.PreLoadEvent> listener)
KeyValueInstanceLoader.PreLoadEvent
.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPreLoad(KeyValueInstanceLoader.PreLoadEvent event) { // handle event here }
listener
- listenerSubscription addPostLoadListener(java.util.function.Consumer<KeyValueInstanceLoader.PostLoadEvent> listener)
KeyValueInstanceLoader.PostLoadEvent
.
You can also add an event listener declaratively using a controller method annotated with Subscribe
:
@Subscribe(id = "fooDl", target = Target.DATA_LOADER) private void onFooDlPostLoad(KeyValueInstanceLoader.PostLoadEvent event) { // handle event here }
listener
- listener