1 package org.apache.turbine.services.cache; 2 3 18 19 import java.io.IOException ; 20 21 import org.apache.turbine.services.TurbineServices; 22 23 33 public abstract class TurbineGlobalCache 34 { 35 41 protected static GlobalCacheService getService() 42 { 43 return (GlobalCacheService) TurbineServices 44 .getInstance().getService(GlobalCacheService.SERVICE_NAME); 45 } 46 47 55 public static CachedObject getObject(String id) 56 throws ObjectExpiredException 57 { 58 return getService().getObject(id); 59 } 60 61 67 public static void addObject(String id, 68 CachedObject o) 69 { 70 getService().addObject(id, o); 71 } 72 73 78 public static void removeObject(String id) 79 { 80 getService().removeObject(id); 81 } 82 83 87 public static int getCacheSize() 88 throws IOException 89 { 90 return getService().getCacheSize(); 91 } 92 93 97 public static int getNumberOfObjects() 98 { 99 return getService().getNumberOfObjects(); 100 } 101 } 102 | Popular Tags |