public enum CacheSyncTiming extends java.lang.Enum<CacheSyncTiming> implements ValueEnum
automatic cache
synchronization
, for a given DataSource
, OperationBinding
or DSRequest
. This property controls the "when" of cache
synchronization; the "how" is controlled by CacheSyncStrategy
. NOTE:
CacheSyncTiming
is intended to allow applications to defer cache synchronization to the point where
response data is actually requested; the primary aim of this is to avoid doing cache sync altogether in cases where the
response data is never requested. There are some mainstream types of request where we know that the response data
unequivocally is required, and for these requests a global default CacheSyncTiming
will be
overridden to "immediate" by Smart GWT because there is no point in deferring cache sync when we know for sure it will
eventually be needed. Thus, cache sync will always run immediately regardless of the default
cacheSyncTiming
setting in these cases:
RPCManager
across from a client-originated request, either by specifying it in
the DSRequest
constructor, or by calling dsRequest.setRPCManager()
The
above only applies to the global default cacheSyncTiming
: a cacheSyncTiming
set explicitly at
the DataSource
, operation
or request
level will usually be honored. However, even an explicit
cacheSyncTiming
setting on the DataSource, operation or request will be ignored in situations where it
could break a framework feature if we honored it. These situations are:
automatic auditing
is in forceEnum Constant and Description |
---|
IMMEDIATE
Obtain cache sync values immediately after the update operation returns
|
LAZY
Defer running cache sync until the first time
getData() is called on the server-side
DSResponse . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue() |
static CacheSyncTiming |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static CacheSyncTiming[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final CacheSyncTiming IMMEDIATE
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "immediate".
public static final CacheSyncTiming LAZY
getData()
is called on the server-side
DSResponse
. As described above, the point of deferring cache sync is to avoid running it at all in cases
where nothing needs the response data (and thus nothing calls getData()
). In addition to the above-listed
cases where we know that cache sync is always going to be required, there are other cases where
getData()
will be called, even if your application code doesn't do so. Some examples:multiple
field in your dataSource and its value requires
transformation because of multipleStorage
or
transformMultipleFields
settings
If this enumerated value is used in a Component XML
file or server-side DataSource descriptor (.ds.xml file), use the value "lazy".
public static CacheSyncTiming[] values()
for (CacheSyncTiming c : CacheSyncTiming.values()) System.out.println(c);
public static CacheSyncTiming valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null