Alachisoft NCache 4.1 - Online Documentation

Write-through Cache Provider

 
Namespace:
 
For enabling Write-through caching, you need a reference of the following assembly in your application:
NCRuntime.jar
 
This assembly contains the class implementing com.alachisoft.ncache.runtime.DatasourceProviders.WriteThruProvider interface provided by NCache. The class implementing this interface gets notification requests to save the data back to the master datasource when new data is added to the cache. Thus, the class needs to include the logic for writing data from cache to the master datasource.
 
Following import statements are required in your project for using Write-Thru provider:
 
import com.alachisoft.ncache.runtime.datasourceprovider.WriteThruProvider;
 
Write-Through Interfaces:
 
In order to use Write-Thru/Write-Behind provider in your application, implement the following methods:
 
public void start(HashMap parameters) throws Exception;
public void stop() throws Exception;
public bool addToSource(String key, Object value) throws Exception;
public HashMap addToSource(String [] keys, Object [] vals) throws Exception;
public bool updateSource(String key, Object value) throws Exception;
public HashMap updateSource(String [] keys, Object [] vals) throws Exception;
public bool removeFromSource(String key) throws Exception;
public HashMap removeFromSource(String [] keys) throws Exception;
public bool clear() throws Exception;
 
 
See Also

 
Copyright © 2005-2012 Alachisoft. All rights reserved.