KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > portlets > monitor > jvm > component > UIJVMRuntimInfo


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

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 /**
14  * May 31, 2004
15  * @author: Tuan Nguyen
16  * @email: tuan08@users.sourceforge.net
17  * @version: $ID$
18  **/

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 JavaDoc type) { return dataHandler_ ; }
56   
57   public Element getTemplate() { return TEMPLATE ; }
58 }
Popular Tags