com.j_spaces.javax.cache
Interface CacheLifeCycleManager

All Known Implementing Classes:
AbstractCacheLoader, HibernateCacheLoaderImpl, HibernateCacheStoreImpl

Deprecated.

public interface CacheLifeCycleManager

The CacheLifeCycleManager provides ability to control the life cycle of the CacheLoader and CacheStore implementation. Space initialization and shutdown methods are provided as part of this interface.


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

The <persistent> section should include the following:

<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> <StorageAdapterURL>${com.gs.home}/GenericPersistProperties</StorageAdapterURL> </persistent>


You may also use the following space properties: space-config.persistent.enabled=true space-config.persistent.CacheLoaderClass=com.j_spaces.examples.jdbccachestore.spaceapi.CacheLoaderImpl space-config.persistent.StorageAdapterClass=com.j_spaces.sadapter.cache.CacheAdapter 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
The space-config.persistent.DataBaseName , space-config.persistent.userName and space-config.persistent.password will be passed into the CacheLifeCycleManager constructor to be used by the CacheStore implementation. Note that only one, CacheLoader or CacheStore, but not both, is allowed to be used since CacheStore extends CacheLoader interface.

Since:
5.1

Nested Class Summary
static interface CacheLifeCycleManager.LifeCycleProperty
          Deprecated. LifeCycleProperty holds the property indicators returned by the underlying driver upon return of init(String, String, String, Properties).
 
Method Summary
 void dropTable(String className)
          Deprecated. drop table represented by this class name.
 Properties init(String dbURL, String user, String password, Properties properties)
          Deprecated. Called when space is started
 void shutdown()
          Deprecated. Called when space is shut down
 

Method Detail

init

Properties init(String dbURL,
                String user,
                String password,
                Properties properties)
Deprecated. 
Called when space is started

Parameters:
dbURL - The StorageAdapterURL space config/schema property value
user - The userName space config/schema property value
password - The password space config/schema property value
properties - Properties taken from property file
Returns:
property indicators CacheLifeCycleManager.LifeCycleProperty between the underlying driver and the cache adapter; can be null.

shutdown

void shutdown()
Deprecated. 
Called when space is shut down


dropTable

void dropTable(String className)
Deprecated. 
drop table represented by this class name.

Parameters:
className - representing the table to be dropped.