|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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
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
CacheStore
implementation.
Note that only one, CacheLoader
or CacheStore
, but not both, is allowed to be used since CacheStore
extends CacheLoader
interface.
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 |
---|
Properties init(String dbURL, String user, String password, Properties properties)
dbURL
- The StorageAdapterURL space config/schema property valueuser
- The userName space config/schema property valuepassword
- The password space config/schema property valueproperties
- Properties taken from property file
CacheLifeCycleManager.LifeCycleProperty
between the
underlying driver and the cache adapter; can be null
.void shutdown()
void dropTable(String className)
className
- representing the table to be dropped.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |