Hi All,

I am trying to create a caching system for my application. Where i am trying
to use the following caching pattern:
- memory
- disk
- remote

For accoplishing this i am using the attached conf.ccf . For being familiar
with JCS i have created a simple java program where i am trying to add some,
say 100,000, string objects into the memory. For the region i am keeping
maxObjects=0 as i understand that keeping this 0 will fulsh each object into
the available auxilary(plzz correct me if i m wrong).

But When i ran this program i am unable to find the directory which i have
mentioned for DiskPath attribute. When the program was running that time i
tried for some lookups, it works at this time. But lookups after restarting
the same program gives.

Can anybody help me in this regard. I have attached the sample java file
also.

Thanks and Regards,
Shailendra
package mycode.jcs;

import org.apache.jcs.JCS;
import org.apache.jcs.access.exception.CacheException;

public class SampleJCS {
	
	private JCS cache = null;
	
	public SampleJCS(String region) throws CacheException{
	  cache = JCS.getInstance(region);
	}
	
	public static void main(String[] args) {
		SampleJCS sample = null;
		try { 
		  sample= new SampleJCS("test");
		
		String value = "some value";
		for(int i = 0; i < 100000; ++i){ 
			sample.add(new Integer(i), value);	
		}

		} catch (CacheException e) {
			e.printStackTrace();
		}
	}
	
	public void add(Object key, Object value) throws CacheException{
		cache.put(key, value);
	}
	
	public Object get(Object key){
		return cache.get(key);
	}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to