1 5 package org.exoplatform.portlets.monitor.jvm.component; 6 7 import org.exoplatform.container.monitor.jvm.v15.MemoryInfo; 8 import org.exoplatform.faces.core.component.UIExoComponentBase; 9 import org.exoplatform.text.template.BeanDataHandler; 10 import org.exoplatform.text.template.DataHandler; 11 import org.exoplatform.text.template.xhtml.Div; 12 import org.exoplatform.text.template.xhtml.Element; 13 import org.exoplatform.text.template.xhtml.Properties; 14 20 public class UIMemoryInfo extends UIExoComponentBase { 21 static private Element TEMPLATE = 22 new Div(). 23 add(new Properties(). 24 addHeader("#{UIMemoryInfo.header.memory-info}"). 25 add("#{UIMemoryInfo.label.heap-memory}", "${heapMemoryUsage}"). 26 add("#{UIMemoryInfo.label.non-heap-memory}", "${nonHeapMemoryUsage}"). 27 add("#{UIMemoryInfo.label.object-pending-finalization-count}","${objectPendingFinalizationCount}"). 28 add("#{UIMemoryInfo.label.is-verbose}","${isVerbose()}"). 29 setDataHandlerType(MemoryInfo.class)). 30 optimize(); 31 32 private BeanDataHandler minfoDataHandler_ ; 33 34 public UIMemoryInfo(MemoryInfo minfo) { 35 setRendererType("TemplateRenderer") ; 36 minfoDataHandler_ = new BeanDataHandler(minfo) ; 37 } 38 39 public DataHandler getDataHandler(Class type) { 40 return minfoDataHandler_ ; 41 } 42 43 public Element getTemplate() { return TEMPLATE ; } 44 } | Popular Tags |