Package com.j_spaces.javax.cache

The Write/Read through Interfaces and Space Cache Interfaces.

See:
          Description

Interface Summary
BasicCacheLoader<K,V> BasicCacheLoader extends the CacheLoader and adds iterator functionality
Cache A cache, being a mechanism for efficient temporary storage of objects for the purpose of improving the overall performance of an application system.
CacheBulk Deprecated.  
CacheBulk.BulkEntry Interface for an entry involved in a bulk operation.
CacheEntry Each CacheEntry should implements this interface.
CacheIterator<E> An iterator over a collection of candidates to be loaded into the space.
CacheIteratorFactory Deprecated.  
CacheLifeCycleManager Deprecated.  
CacheLifeCycleManager.LifeCycleProperty LifeCycleProperty holds the property indicators returned by the underlying driver upon return of CacheLifeCycleManager.init(String, String, String, Properties).
CacheListener The listener interface for receiving cache events.
CacheLoader The CacheLoader implementation is provided to ensure read-through behavior of the space.
CacheQuery The CacheQuery is used as part of the CacheLoader implementation.
CacheStore The CacheStore implementation is provided to ensure read-through and write-through behavior of the space.
EvictionStrategy EvictionStrategy decides which entry to evict when the cache reaches its limits.
IConverter The IConverter Interface provides conversion methods when using GigaSpaces Entry internal representation - The IGSEntry.
 

Class Summary
AbstractCacheLoader Deprecated.  
 

Exception Summary
CacheException Description: CacheException is a generic exception, which indicates a cache error has occurred.
 

Package com.j_spaces.javax.cache Description

The Write/Read through Interfaces and Space Cache Interfaces.
Write/Read Through achieved using CacheStore and CacheLoader interfaces.
These are called when space operations performed allowing the space to interact with external data sources.


Configuration
CacheLoader/Store is configured in space schema XML configuration file as a persistent adapter.

The space schema should include the following:

<space-config>
<persistent>
<enabled>true</enabled>
<!-- name of the storage adapter class to be used by the space -->
<StorageAdapterClass>com.j_spaces.sadapter.cache.CacheAdapter</StorageAdapterClass>
<!-- CacheLoader or CacheStore implementation class name that will be used by space -->
<CacheLoaderClass>com.j_spaces.examples.jdbccachestore.spaceapi.CacheLoaderImpl</CacheLoaderClass>
<DataBaseName>jdbc:hsqldb:testDB</DataBaseName>
<userName>sa</userName>
<password></password>
</persistent>
<engine>
<cache_policy>0</cache_policy>
</engine>
</space-config>


You may also use the following space properties:
space-config.persistent.enabled=true
space-config.persistent.StorageAdapterClass=com.j_spaces.sadapter.cache.CacheAdapter
space-config.persistent.CacheLoaderClass=com.j_spaces.examples.jdbccachestore.spaceapi.CacheLoaderImpl
space-config.persistent.DataBaseName=jdbc:hsqldb:hsql://localhost:9003
space-config.persistent.userName=sa
space-config.persistent.password=
space-config.engine.cache_policy=0

You must use space-config.engine.cache_policy=0 (LRU policy) to activate the CacheStore and CacheLoader implementation.

It is recommended to configure also the following to control the space memory usage and the eviction behavior:
space-config.engine.memory_usage.enabled=true
space-config.engine.memory_usage.high_watermark_percentage=95
space-config.engine.memory_usage.write_only_block_percentage=85
space-config.engine.memory_usage.write_only_check_percentage=76
space-config.engine.memory_usage.low_watermark_percentage=75
space-config.engine.memory_usage.eviction_batch_size=500

When a clustered space using CacheStore/Loader you should start all nodes using the following property:
-Dcom.gs.cluster.cache-loader.external-data-source=true

When a clustered space using Central for all nodes you should start all nodes using the following property:
-Dcom.gs.cluster.cache-loader.central-data-source=true

When the clustered space using different Database instance for each space instance you should start each node using the following property:
-Dcom.gs.cluster.cache-loader.central-data-source=false