1 23 24 package com.sun.enterprise.deployment.runtime.web; 25 26 import com.sun.enterprise.deployment.runtime.RuntimeDescriptor; 27 28 35 public class Cache extends WebPropertyContainer 36 { 37 38 static public final String CACHE_HELPER = "CacheHelper"; static public final String DEFAULT_HELPER = "DefaultHelper"; static public final String PROPERTY = "WebProperty"; static public final String CACHE_MAPPING = "CacheMapping"; static public final String MAX_ENTRIES = "MaxEntries"; 43 static public final String TIMEOUT_IN_SECONDS = "TimeoutInSeconds"; 44 static public final String ENABLED = "Enabled"; 45 46 public Cache() { 47 48 setAttributeValue("MaxEntries", "4096"); 50 setAttributeValue("TimeoutInSeconds", "30"); 51 } 52 53 public void setCacheHelper(int index, CacheHelper value) 55 { 56 setValue(CACHE_HELPER, index, value); 57 } 58 59 public CacheHelper getCacheHelper(int index) 61 { 62 return (CacheHelper)getValue(CACHE_HELPER, index); 63 } 64 65 public void setCacheHelper(CacheHelper[] value) 67 { 68 setValue(CACHE_HELPER, value); 69 } 70 71 public CacheHelper[] getCacheHelper() 73 { 74 return (CacheHelper[])getValues(CACHE_HELPER); 75 } 76 77 public int sizeCacheHelper() 79 { 80 return size(CACHE_HELPER); 81 } 82 83 public int addCacheHelper(CacheHelper value) 85 { 86 return addValue(CACHE_HELPER, value); 87 } 88 89 public void addNewCacheHelper(CacheHelper value) 91 { 92 addCacheHelper(value); 93 } 94 95 public int removeCacheHelper(CacheHelper value) 100 { 101 return removeValue(CACHE_HELPER, value); 102 } 103 104 public void setDefaultHelper(DefaultHelper value) 106 { 107 setValue(DEFAULT_HELPER, value); 108 } 109 110 public DefaultHelper getDefaultHelper() 112 { 113 return (DefaultHelper)getValue(DEFAULT_HELPER); 114 } 115 116 public void setCacheMapping(int index, CacheMapping value) 118 { 119 setValue(CACHE_MAPPING, index, value); 120 } 121 122 public CacheMapping getCacheMapping(int index) 124 { 125 return (CacheMapping)getValue(CACHE_MAPPING, index); 126 } 127 128 public void setCacheMapping(CacheMapping[] value) 130 { 131 setValue(CACHE_MAPPING, value); 132 } 133 134 public CacheMapping[] getCacheMapping() 136 { 137 return (CacheMapping[])getValues(CACHE_MAPPING); 138 } 139 140 public int sizeCacheMapping() 142 { 143 return size(CACHE_MAPPING); 144 } 145 146 public int addCacheMapping(CacheMapping value) 148 { 149 return addValue(CACHE_MAPPING, value); 150 } 151 152 public void addNewCacheMapping(CacheMapping value) 154 { 155 addCacheMapping(value); 156 } 157 158 public int removeCacheMapping(CacheMapping value) 163 { 164 return removeValue(CACHE_MAPPING, value); 165 } 166 167 public boolean verify() 169 { 170 return true; 171 } 172 173 } 174 | Popular Tags |