1 5 package org.exoplatform.portlets.monitor.jvm.component; 6 7 import org.exoplatform.container.monitor.jvm.JVMRuntimeInfo; 8 import org.exoplatform.faces.core.component.UIExoComponentBase; 9 import org.exoplatform.text.template.*; 10 import org.exoplatform.text.template.xhtml.Element; 11 import org.exoplatform.text.template.xhtml.LongTextPopupFormater; 12 import org.exoplatform.text.template.xhtml.Properties; 13 19 public class UIJVMRuntimInfo extends UIExoComponentBase { 20 static private LongTextPopupFormater popupTextFt_ = new LongTextPopupFormater(50); 21 static private Element TEMPLATE = 22 new Properties(). 23 add("#{UIJVMRuntimInfo.label.name}","${name}"). 24 add("#{UIJVMRuntimInfo.label.SpecName}", "${SpecName}"). 25 add("#{UIJVMRuntimInfo.label.SpecVendor}","${SpecVendor}"). 26 add("#{UIJVMRuntimInfo.label.SpecVersion}","${SpecVersion}"). 27 add("#{UIJVMRuntimInfo.label.ManagementSpecVersion}", "${ManagementSpecVersion}"). 28 29 add("#{UIJVMRuntimInfo.label.VmName}", "${VmName}"). 30 add("#{UIJVMRuntimInfo.label.VmVendor}", "${VmVendor}"). 31 add("#{UIJVMRuntimInfo.label.VmVersion}", "${VmVersion}"). 32 33 add("#{UIJVMRuntimInfo.label.BootClassPathSupported}", "${BootClassPathSupported}", popupTextFt_). 34 add("#{UIJVMRuntimInfo.label.BootClassPath}", "${BootClassPath}", popupTextFt_). 35 add("#{UIJVMRuntimInfo.label.ClassPath}", "${ClassPath}", popupTextFt_). 36 add("#{UIJVMRuntimInfo.label.LibraryPath}", "${LibraryPath}", popupTextFt_). 37 38 add("#{UIJVMRuntimInfo.label.StartTime}", "${StartTime}"). 39 add("#{UIJVMRuntimInfo.label.Uptime}", "${Uptime}"). 40 41 add("#{UIJVMRuntimInfo.label.InputArguments}", "${InputArguments}", 42 new ListFormater(null, "<br/>")). 43 add("#{UIJVMRuntimInfo.label.SystemProperties}", "${SystemProperties}", 44 new MapFormater(null, "<br/>").setValueFormater(popupTextFt_)). 45 optimize(); 46 47 48 private DataHandler dataHandler_ ; 49 50 public UIJVMRuntimInfo(JVMRuntimeInfo osinfo) { 51 setRendererType("TemplateRenderer") ; 52 dataHandler_ = new BeanDataHandler(osinfo); 53 } 54 55 public DataHandler getDataHandler(Class type) { return dataHandler_ ; } 56 57 public Element getTemplate() { return TEMPLATE ; } 58 } | Popular Tags |