Loading
EhCache Example

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  EHCACHE Example ?


Ans)

 

Step 1: Get the EhCache Manager

File f = new File(EHCACHE_CONFIG_FULL_PATH);
BufferedInputStream bis = new BufferedInputStream(
new FileInputStream(f));
CacheManager cacheManager = CacheManager.create(bis);


Step 2 : Putting Data in Cache
cacheManager.getCache(YOUR_CACHE).get(key));
Object valeu = element.getValue();

Step 3 : Getting Data From Cache
cacheManager.getCache(YOUR_CACHE).put(new Element(key, value));

Configuration : Ehcache.xml

<cache name="YOUR_CACHE"
maxElementsInMemory="1000"
eternal="true"
timeToLiveSeconds="0"
timeToIdleSeconds="0"
diskPersistent="false"
overflowToDisk="false"
memoryStoreEvictionPolicy="LRU"
>

 



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

EhCache Example


EhCache Example

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free