|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openspaces.core.space.cache.AbstractLocalCacheSpaceFactoryBean org.openspaces.core.space.cache.LocalCacheSpaceFactoryBean
public class LocalCacheSpaceFactoryBean
In some cases, the memory capacity of an individual application is not capable of holding all the information in the local application memory. When this happens, the desired solution will be to hold only a portion of the information in the application's memory and the rest in a separate process(s). This mode is also known as two-level cache. In this mode, the cache is divided into two components, local cache and master cache. The local cache always resides in the physical address space of the application and the master cache runs in a different process. The master cache is used to share data among the different embedded local caches running within other application instances.
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.
Field Summary | |
---|---|
static String |
LOCAL_CACHE_UPDATE_MODE_PULL
|
static String |
LOCAL_CACHE_UPDATE_MODE_PUSH
|
Fields inherited from class org.openspaces.core.space.cache.AbstractLocalCacheSpaceFactoryBean |
---|
logger |
Constructor Summary | |
---|---|
LocalCacheSpaceFactoryBean()
|
Method Summary | |
---|---|
protected Properties |
createCacheProperties()
Returns newly created properties setting the SpaceURL.LOCAL_CACHE_UPDATE_MODE based
on either localCacheUpdateMode or
localCacheUpdateModeName . |
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 |
setUpdateModeName(String localCacheUpdateModeName)
Allows to set the local cache update mode using a descriptive name instead of integer constants using localCacheUpdateMode . |
Methods inherited from class org.openspaces.core.space.cache.AbstractLocalCacheSpaceFactoryBean |
---|
afterPropertiesSet, destroy, getBeanName, getObject, getObjectType, getServicesDetails, isSingleton, prepareUrl, setBeanName, setProperties, setSpace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LOCAL_CACHE_UPDATE_MODE_PUSH
public static final String LOCAL_CACHE_UPDATE_MODE_PULL
Constructor Detail |
---|
public LocalCacheSpaceFactoryBean()
Method Detail |
---|
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 setSize(int size)
public void setUpdateModeName(String localCacheUpdateModeName)
localCacheUpdateMode
. Accepts either
push
or pull
.
(int)
protected Properties createCacheProperties()
SpaceURL.LOCAL_CACHE_UPDATE_MODE
based
on either localCacheUpdateMode
or
localCacheUpdateModeName
.
createCacheProperties
in class AbstractLocalCacheSpaceFactoryBean
|
GigaSpaces XAP 7.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |