1 4 package com.tc.admin.dso; 5 6 import com.tc.objectserver.api.GCStats; 7 8 import com.tc.admin.AdminClient; 9 import com.tc.admin.common.XObjectTableModel; 10 11 public class GCStatsTableModel extends XObjectTableModel { 12 private static final String [] FIELDS = { 13 "Iteration", 14 "StartDate", 15 "ElapsedTime", 16 "BeginObjectCount", 17 "CandidateGarbageCount", 18 "ActualGarbageCount" 19 }; 20 21 private static final String [] HEADERS = 22 AdminClient.getContext().getMessages( 23 new String [] { 24 "dso.gcstats.iteration", 25 "dso.gcstats.startTime", 26 "dso.gcstats.elapsedTime", 27 "dso.gcstats.beginObjectCount", 28 "dso.gcstats.candidateGarbageCount", 29 "dso.gcstats.actualGarbageCount" 30 }); 31 32 public GCStatsTableModel() { 33 super(GCStatsWrapper.class, FIELDS, HEADERS); 34 } 35 36 public void setGCStats(GCStats[] gcStats) { 37 int count = gcStats != null ? gcStats.length : 0; 38 GCStatsWrapper[] wrappers = new GCStatsWrapper[count]; 39 40 for(int i = 0; i < count; i++) { 41 wrappers[i] = new GCStatsWrapper(gcStats[i]); 42 } 43 44 set(wrappers); 45 } 46 47 public void addGCStats(GCStats gcStats) { 48 add(0, new GCStatsWrapper(gcStats)); 49 fireTableRowsInserted(0, 0); 50 } 51 } 52 | Popular Tags |