public abstract class OAObjectCacheTrigger<T extends OAObject> extends Object implements OAFilter<T>
Modifier and Type | Field and Description |
---|---|
protected boolean |
bServerSideOnly |
Constructor and Description |
---|
OAObjectCacheTrigger(Class clazz)
Create new cache trigger.
|
OAObjectCacheTrigger(Class clazz,
OAFilter<T> filter)
Create new cache trigger.
|
OAObjectCacheTrigger(Class clazz,
OAFilter<T> filter,
String... dependentPropPaths) |
OAObjectCacheTrigger(Hub<T> hub,
OAFilter<T> filter,
String... dependentPropPaths) |
Modifier and Type | Method and Description |
---|---|
void |
addDependentProperty(String prop)
add a property to listen to.
|
void |
addFilter(OAFilter<T> f)
Add a filter that is used to determine if an object from the cache will be added to hub.
|
void |
addFilter(OAFilter<T> f,
boolean bCallRefresh)
Add a filter that is used to determine if an object from the cache will be added to hub.
|
void |
addFilter(OAFilter<T> f,
String... dependentPropPaths) |
void |
close() |
protected void |
finalize() |
boolean |
isUsed(T obj)
Called to see if an object should be included in hub.
|
abstract void |
onTrigger(T obj)
Method that will be called when isUsed() returns true, and isUsedFromObjectCache() returns true.
|
void |
refresh()
Clear hub and check all cached objects to see if they should be added to hub.
|
void |
setServerSideOnly(boolean b)
This needs to be set to true if it is only created on the server.
|
protected void |
setupTrigger() |
public OAObjectCacheTrigger(Class clazz)
public OAObjectCacheTrigger(Class clazz, OAFilter<T> filter)
public OAObjectCacheTrigger(Class clazz, OAFilter<T> filter, String... dependentPropPaths)
public void setServerSideOnly(boolean b)
public void addFilter(OAFilter<T> f)
f
- filter to add. By default isUsed() will return false if any of the filters.isUsed() returns false.that has an option for refreshing.
public void addFilter(OAFilter<T> f, boolean bCallRefresh)
f
- filter to add. By default isUsed() will return false if any of the filters.isUsed() returns false.bCallRefresh
- if true, then call refresh.public void refresh()
public void addDependentProperty(String prop)
protected void setupTrigger()
public void close()
protected void finalize() throws Throwable
public boolean isUsed(T obj)
public abstract void onTrigger(T obj)
obj
- Copyright © 1999–2019 ViaOA. All rights reserved.