KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > soap > CacheServer


1 package org.jahia.soap;
2
3 import org.jahia.registries.ServicesRegistry;
4 import org.jahia.services.cache.CacheFactory;
5
6 /**
7  * <p>Title: </p>
8  * <p>Description: </p>
9  * <p>Copyright: Copyright (c) 2002</p>
10  * <p>Company: </p>
11  * @author unascribed
12  * @version 1.0
13  */

14
15 public class CacheServer {
16
17     private ServicesRegistry sReg = null;
18
19     public CacheServer() {
20         sReg = ServicesRegistry.getInstance();
21     }
22
23     public int getOutputCacheEntriesCount() {
24         try {
25             return CacheFactory.getHtmlCache().size();
26         } catch (Throwable JavaDoc t) {
27             return 0;
28         }
29     }
30
31     public void flush() {
32         try {
33             CacheFactory.getHtmlCache().flush();
34         } catch (Throwable JavaDoc t) {
35
36         }
37     }
38
39     public void flushByName(String JavaDoc name) {
40         try {
41             CacheFactory.getInstance().getCache(name).flush();
42         } catch (Throwable JavaDoc t) {
43
44         }
45     }
46
47 }
48
Popular Tags