public class LocalCacheSpaceFactoryBean extends AbstractLocalCacheSpaceFactoryBean
In this mode, when a read/get operation is called, a matching object is first looked up in the local embedded cache. If the object is not found in the local cache, it will be searched for in the master cache. If it is not found in the master cache, it will reload the data from the data source. Updates on the central cache will be propagated into all local embedded cache instances in either pull or push mode, using unicast or multicast protocol.
Modifier and Type | Field and Description |
---|---|
static String |
LOCAL_CACHE_UPDATE_MODE_PULL |
static String |
LOCAL_CACHE_UPDATE_MODE_PUSH |
logger
Constructor and Description |
---|
LocalCacheSpaceFactoryBean() |
Modifier and Type | Method and Description |
---|---|
protected IJSpace |
createCache(com.gigaspaces.internal.client.spaceproxy.IDirectSpaceProxy remoteSpace)
Creates the local cache.
|
protected com.gigaspaces.internal.client.cache.SpaceCacheConfig |
getCacheConfig() |
void |
setMaxTimeToLive(long maxTimeToLive) |
void |
setSize(int size)
Sets the local cache size.
|
void |
setUpdateMode(int localCacheUpdateMode)
If set to
SpaceURL.UPDATE_MODE_PULL (1 ) each update triggers an
invalidation event at every cache instance. |
void |
setUpdateMode(LocalCacheSpaceConfigurer.UpdateMode localCacheUpdateMode) |
void |
setUpdateModeName(String localCacheUpdateModeName)
Allows to set the local cache update mode using a descriptive name instead of integer
constants using
localCacheUpdateMode . |
addProperty, afterPropertiesSet, destroy, getBeanName, getObject, getObjectType, getServicesDetails, isSingleton, setBatchSize, setBatchTimeout, setBeanName, setMaxDisconnectionDuration, setProperties, setSpace, validate
public static final String LOCAL_CACHE_UPDATE_MODE_PUSH
public static final String LOCAL_CACHE_UPDATE_MODE_PULL
public void setUpdateMode(int localCacheUpdateMode)
SpaceURL.UPDATE_MODE_PULL
(1
) each update triggers an
invalidation event at every cache instance. The invalidate event marks the object in the
local cache instances as invalid. Therefore, an attempt to read this object triggers a reload
process in the master space. This configuration is useful in cases where objects are updated
frequently, but the updated value is required by the application less frequently.
If set to SpaceURL.UPDATE_MODE_PUSH
(2
) the master pushes the
updates to the local cache, which holds a reference to the same updated object.
setUpdateModeName(String)
public void setUpdateMode(LocalCacheSpaceConfigurer.UpdateMode localCacheUpdateMode)
public void setUpdateModeName(String localCacheUpdateModeName)
localCacheUpdateMode
. Accepts either
push
or pull
.(int)
public void setMaxTimeToLive(long maxTimeToLive)
public void setSize(int size)
protected com.gigaspaces.internal.client.cache.SpaceCacheConfig getCacheConfig()
getCacheConfig
in class AbstractLocalCacheSpaceFactoryBean
protected IJSpace createCache(com.gigaspaces.internal.client.spaceproxy.IDirectSpaceProxy remoteSpace)
createCache
in class AbstractLocalCacheSpaceFactoryBean
Copyright © GigaSpaces.