1 package org.enhydra.server; 2 3 4 import com.lutris.appserver.server.Application; 5 import com.lutris.appserver.server.httpPresentation.HttpPresentationManager; 6 import com.lutris.util.Config; 7 import com.lutris.util.KeywordValueException; 8 9 10 21 22 public class PresentationInfo { 23 24 public PresentationInfo() { 25 } 26 private String POCache = "Enabled"; 27 private String resourceCache = "Disabled"; 28 private String EntriesPOCache; 29 private String EntriesResourceCache; 30 private Config config; 31 private HttpPresentationManager pm; 32 33 public PresentationInfo(Application app,Config pmConfig)throws KeywordValueException{ 34 config = pmConfig; 36 pm = null; 37 POCache = "Enabled"; 38 resourceCache = "Disabled"; 39 EntriesPOCache = "N/A"; 40 EntriesResourceCache = "N/A"; 41 if (config != null) { 42 if(config.containsKey("CacheClasses")) 43 if (config.getBoolean("CacheClasses")) 44 POCache = "Enabled"; 45 else 46 POCache = "Disabled"; 47 if(config.containsKey("CacheFiles")) 48 if (config.getBoolean("CacheFiles")) 49 resourceCache = "Enabled"; 50 else 51 resourceCache = "Disabled"; 52 } 53 if (app != null) { 54 pm = app.getHttpPresentationManager(); 55 if (pm != null) { 56 EntriesPOCache = String.valueOf(pm.sizeofPOCache()); 57 EntriesResourceCache = String.valueOf(pm.sizeofResourceCache()); 58 }else log("WARNING: PresentationManager = null"); 59 }else log("WARNING: application = null"); 60 } 61 62 63 64 65 66 public String getPOCache() { 67 return POCache; 68 } 69 public String getResourceCache() { 70 return resourceCache; 71 } 72 public String getEntriesPOCache() { 73 return EntriesPOCache; 74 } 75 public String getEntriesResourceCache() { 76 return EntriesResourceCache; 77 } 78 private void log(String msg) { 79 System.err.println("EnhydraServer, Presentation Info: "+msg); 81 } 82 } | Popular Tags |