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 |
Constructor and Description |
---|
LocalCacheSpaceFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(String name,
String value) |
void |
afterPropertiesSet()
Constructs a new local cache
IJSpace based on the master local cache set using setSpace(IJSpace) and a set of properties driving the actual local cache type from the
configuration. |
void |
destroy()
Closes the local cache space
|
protected String |
getBeanName() |
Object |
getObject()
Returns an
IJSpace that is the local cache wrapping the
master proxy set using setSpace(com.j_spaces.core.IJSpace) . |
Class<? extends IJSpace> |
getObjectType()
Returns the type of the factory object.
|
ServiceDetails[] |
getServicesDetails()
Retruns one or more service details that the service exposes.
|
void |
setBatchSize(int batchSize) |
void |
setBatchTimeout(long batchTimeout) |
void |
setBeanName(String beanName)
Spring callback that sets the bean name.
|
void |
setMaxDisconnectionDuration(long maxDisconnectionDuration) |
void |
setMaxTimeToLive(long maxTimeToLive) |
void |
setProperties(Properties properties)
Sets additional properties for the local cache.
|
void |
setSize(int size)
Sets the local cache size.
|
void |
setSpace(IJSpace space)
Sets the master space that a local cache will be built on top.
|
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 . |
isSingleton
public static final String LOCAL_CACHE_UPDATE_MODE_PUSH
public static final String LOCAL_CACHE_UPDATE_MODE_PULL
public Object getObject()
IJSpace
that is the local cache wrapping the
master proxy set using setSpace(com.j_spaces.core.IJSpace)
.public Class<? extends IJSpace> getObjectType()
public void afterPropertiesSet()
IJSpace
based on the master local cache set using setSpace(IJSpace)
and a set of properties driving the actual local cache type from the
configuration. Additional properties are applied based on setProperties(java.util.Properties)
.public void destroy()
public ServiceDetails[] getServicesDetails()
ServiceDetailsProvider
public void setBeanName(String beanName)
protected String getBeanName()
public void setSpace(IJSpace space)
public void setProperties(Properties properties)
public void setBatchSize(int batchSize)
public void setBatchTimeout(long batchTimeout)
public void setMaxDisconnectionDuration(long maxDisconnectionDuration)
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)
Copyright © GigaSpaces.