Changeset 4247
- Timestamp:
- 01/10/14 09:35:01 (10 years ago)
- Location:
- vlo/branches/to-wicket-1.6
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vlo/branches/to-wicket-1.6/vlo_importer/src/main/java/eu/clarin/cmdi/vlo/config/VloConfig.java
r4071 r4247 105 105 106 106 /** 107 * Initiali ze the ConfigFilePersister's reference to the interface107 * Initialise the ConfigFilePersister's reference to the interface 108 108 */ 109 109 ConfigFilePersister.setLogger(VloConfig.logger); … … 148 148 } 149 149 150 /* *150 /* 151 151 * VLO application parameter members<br><br> 152 152 * 153 * Initialise the annotated members in a proper way. This will allow them to154 * be linearised to corresponding elements in an XML file.153 * Please Initialise the annotated members in a proper way. This will allow 154 * them to be linearised to corresponding elements in an XML file. 155 155 * 156 156 * Please refer to the general VLO documentation for a description of the 157 157 * member parameters. 158 158 */ 159 160 // page cache related parameters 161 162 @Element 163 private static int pagesInApplicationCache = 0; 164 165 @Element 166 private static int sessionCacheSize = 0; 159 167 160 168 // data base related parameters … … 294 302 * application. 295 303 */ 296 304 305 /** 306 * Get the value of the pagesInApplicationCache parameter<br><br> 307 * 308 * The parameter represents the number of pages that Wicket will allow 309 * to be stored in the application's cache. 310 * 311 * @return the value 312 */ 313 public static int getPagesInApplicationCache() { 314 return pagesInApplicationCache; 315 } 316 317 /** 318 * Set the value of the pagesInApplicationCache parameter<br><br> 319 * 320 * The parameter represents the number of pages that Wicket will allow 321 * to be stored in the application's cache. 322 * 323 * @param param the value 324 */ 325 public static void setPagesInApplicationCache(int param) { 326 pagesInApplicationCache = param; 327 } 328 329 /** 330 * Get the value of the sessionCacheSize parameter<br><br> 331 * 332 * The parameter represents the size in kilobytes of the session 333 * page cache. 334 * 335 * @return the value 336 */ 337 public static int getSessionCacheSize() { 338 return sessionCacheSize; 339 } 340 341 /** 342 * Set the value of the sessionCacheSize parameter<br><br> 343 * 344 * The parameter represents the size in megabytes of the session 345 * page cache. 346 * 347 * @param param the value 348 */ 349 public static void setSessionCacheSize(int param) { 350 sessionCacheSize = param; 351 } 352 297 353 /** 298 354 * Get the value of the deleteAllFirst parameter<br><br> … … 302 358 * 303 359 * @return the value 304 */ 305 360 */ 306 361 public static boolean deleteAllFirst() { 307 362 return deleteAllFirst; -
vlo/branches/to-wicket-1.6/vlo_importer/src/main/resources/VloConfig.xml
r4030 r4247 1 1 <VloConfig> 2 3 <pagesInApplicationCache>128</pagesInApplicationCache> 4 5 <sessionCacheSize>500</sessionCacheSize> 2 6 3 7 <deleteAllFirst>true</deleteAllFirst> -
vlo/branches/to-wicket-1.6/vlo_importer/src/test/java/eu/clarin/cmdi/vlo/config/VloConfigTest.java
r4030 r4247 87 87 } 88 88 89 /** 90 * Test the getPagesInApplicationCache method 91 */ 92 @Test 93 public void testGetPagesInApplicationCache() { 94 95 System.out.println("getPagesInApplicationCache"); 96 97 int expResult = 128; 98 int result = VloConfig.getPagesInApplicationCache(); 99 100 assertEquals(expResult, result); 101 } 102 103 /** 104 * Test the setPagesInApplicationCache method 105 */ 106 @Test 107 public void testSetPagesInApplicationCache() { 108 109 System.out.println("setPagesInApplicationCache"); 110 111 int param = 500; 112 113 VloConfig.setPagesInApplicationCache(param); 114 115 int result = VloConfig.getPagesInApplicationCache(); 116 117 assertEquals(param, result); 118 } 119 120 121 /** 122 * Test the getSessionCacheSize method 123 */ 124 @Test 125 public void testGetSessionCacheSize() { 126 127 System.out.println("getPagesInApplicationCache"); 128 129 int expResult = 128; 130 int result = VloConfig.getPagesInApplicationCache(); 131 132 assertEquals(expResult, result); 133 } 134 135 /** 136 * Test the setSessionCacheSize method 137 */ 138 @Test 139 public void testSetSessionCacheSize() { 140 141 System.out.println("setPagesInApplicationCache"); 142 143 int param = 128; 144 145 VloConfig.setMaxDocsInList(param); 146 147 int result = VloConfig.getPagesInApplicationCache(); 148 149 assertEquals(param, result); 150 } 151 89 152 /** 90 153 * Test the getMaxDocsInList method -
vlo/branches/to-wicket-1.6/vlo_web_app/src/main/java/eu/clarin/cmdi/vlo/VloWebApplication.java
r4244 r4247 20 20 import org.apache.wicket.request.mapper.parameter.PageParameters; 21 21 import org.apache.wicket.util.string.StringValue; 22 import org.apache.wicket.util.lang.Bytes; 22 23 23 24 /** … … 86 87 87 88 if (inContext) { 88 89 89 90 /* 90 91 * send messages to objects that need a static reference to this web … … 110 111 getRequestCycleListeners().add(new CustomRequestCycleListener()); 111 112 } 113 114 // configure cache by applying the vlo configuration settings to it 115 this.getStoreSettings().setInmemoryCacheSize(VloConfig.getPagesInApplicationCache()); 116 this.getStoreSettings().setMaxSizePerSession(Bytes.kilobytes((long)VloConfig.getSessionCacheSize())); 112 117 113 118 // creata an object referring to the search results … … 140 145 */ 141 146 public VloWebApplication() { 142 147 143 148 /* 144 149 * Read the application's packaged configuration
Note: See TracChangeset
for help on using the changeset viewer.