View Javadoc

1   package com.melloware.jukes.gui.view.dialogs;
2   
3   import java.beans.BeanInfo;
4   import java.beans.PropertyChangeEvent;
5   import java.beans.PropertyChangeListener;
6   
7   import javax.swing.JPanel;
8   
9   import org.hibernate.stat.Statistics;
10  
11  import com.l2fprod.common.beans.BaseBeanInfo;
12  import com.l2fprod.common.beans.ExtendedPropertyDescriptor;
13  import com.l2fprod.common.model.DefaultBeanInfoResolver;
14  import com.l2fprod.common.propertysheet.Property;
15  import com.l2fprod.common.propertysheet.PropertySheet;
16  import com.l2fprod.common.propertysheet.PropertySheetPanel;
17  import com.l2fprod.common.swing.LookAndFeelTweaks;
18  import com.melloware.jukes.db.HibernateUtil;
19  import com.melloware.jukes.gui.tool.Resources;
20  
21  /**
22   * A <code>PropertySheet</code> for the <code>Hibernate</code> statistics.
23   * <p>
24   * Copyright (c) 1999-2007 Melloware, Inc. <http://www.melloware.com>
25   * @author Emil A. Lefkof III <info@melloware.com>
26   * @version 4.0
27   */
28  public final class PropertySheetHibernateStats
29      extends JPanel {
30  	
31  	private static final String ENTITY = "Entity";
32  	private static final String CACHE = "Cache";
33  	private static final String COLLECTIONS = "Collections";
34  	private static final String SESSION = "Session";
35  	private static final String TRANSACTION = "Transaction";
36  	private static final String QUERY = "Query";
37  
38      public PropertySheetHibernateStats() {
39          setLayout(LookAndFeelTweaks.createVerticalPercentLayout());
40  
41          final Bean data = new Bean();
42  
43          Statistics stats = HibernateUtil.getSessionFactory().getStatistics();
44          data.setSessionOpenCount(stats.getSessionOpenCount());
45          data.setSessionCloseCount(stats.getSessionCloseCount());
46          data.setSuccessfulTransactionCount(stats.getSuccessfulTransactionCount());
47          data.setTransactionCount(stats.getTransactionCount());
48          data.setOptimisticFailureCount(stats.getOptimisticFailureCount());
49          data.setFlushCount(stats.getFlushCount());
50          data.setConnectCount(stats.getConnectCount());
51          data.setPrepareStatementCount(stats.getPrepareStatementCount());
52          data.setCloseStatementCount(stats.getCloseStatementCount());
53          data.setSecondLevelCachePutCount(stats.getSecondLevelCachePutCount());
54          data.setSecondLevelCacheHitCount(stats.getSecondLevelCacheHitCount());
55          data.setSecondLevelCacheMissCount(stats.getSecondLevelCacheMissCount());
56          data.setEntityLoadCount(stats.getEntityLoadCount());
57          data.setEntityUpdateCount(stats.getEntityUpdateCount());
58          data.setEntityInsertCount(stats.getEntityInsertCount());
59          data.setEntityDeleteCount(stats.getEntityDeleteCount());
60          data.setEntityFetchCount(stats.getEntityFetchCount());
61          data.setQueryExecutionCount(stats.getQueryExecutionCount());
62          data.setQueryCachePutCount(stats.getQueryCachePutCount());
63          data.setQueryCacheHitCount(stats.getQueryCacheHitCount());
64          data.setQueryCacheMissCount(stats.getQueryCacheMissCount());
65          data.setQueryExecutionMaxTime(stats.getQueryExecutionMaxTime());
66          data.setCollectionLoadCount(stats.getCollectionLoadCount());
67          data.setCollectionRecreateCount(stats.getCollectionRecreateCount());
68          data.setCollectionRemoveCount(stats.getCollectionRemoveCount());
69          data.setCollectionUpdateCount(stats.getCollectionUpdateCount());
70  
71          DefaultBeanInfoResolver resolver = new DefaultBeanInfoResolver();
72          BeanInfo beanInfo = resolver.getBeanInfo(data);
73  
74          PropertySheetPanel sheet = new PropertySheetPanel();
75          sheet.setMode(PropertySheet.VIEW_AS_CATEGORIES);
76          sheet.setProperties(beanInfo.getPropertyDescriptors());
77          sheet.readFromObject(data);
78          sheet.setDescriptionVisible(true);
79          sheet.setSortingCategories(true);
80          sheet.setSortingProperties(true);
81          add(sheet, "*");
82  
83          // everytime a property change, update the button with it
84          PropertyChangeListener listener = new PropertyChangeListener() {
85              public void propertyChange(PropertyChangeEvent evt) {
86                  Property prop = (Property)evt.getSource();
87                  prop.writeToObject(data);
88              }
89          };
90          sheet.addPropertySheetChangeListener(listener);
91      }
92  
93      /**
94       * Class used to hold the property info.
95       */
96      public static class Bean {
97          private long closeStatementCount;
98          private long collectionFetchCount;
99          private long collectionLoadCount;
100         private long collectionRecreateCount;
101         private long collectionRemoveCount;
102         private long collectionUpdateCount;
103         private long connectCount;
104         private long entityDeleteCount;
105         private long entityFetchCount;
106         private long entityInsertCount;
107         private long entityLoadCount;
108         private long entityUpdateCount;
109         private long flushCount;
110         private long optimisticFailureCount;
111         private long prepareStatementCount;
112         private long queryCacheHitCount;
113         private long queryCacheMissCount;
114         private long queryCachePutCount;
115         private long queryExecutionCount;
116         private long queryExecutionMaxTime;
117         private long secondLevelCacheHitCount;
118         private long secondLevelCacheMissCount;
119         private long secondLevelCachePutCount;
120         private long sessionCloseCount;
121 
122         private long sessionOpenCount;
123         private long successfulTransactionCount;
124         private long transactionCount;
125 
126         /**
127          * Gets the closeStatementCount.
128          * <p>
129          * @return Returns the closeStatementCount.
130          */
131         public long getCloseStatementCount() {
132             return this.closeStatementCount;
133         }
134 
135         /**
136          * Gets the collectionFetchCount.
137          * <p>
138          * @return Returns the collectionFetchCount.
139          */
140         public long getCollectionFetchCount() {
141             return this.collectionFetchCount;
142         }
143 
144         /**
145          * Gets the collectionLoadCount.
146          * <p>
147          * @return Returns the collectionLoadCount.
148          */
149         public long getCollectionLoadCount() {
150             return this.collectionLoadCount;
151         }
152 
153         /**
154          * Gets the collectionRecreateCount.
155          * <p>
156          * @return Returns the collectionRecreateCount.
157          */
158         public long getCollectionRecreateCount() {
159             return this.collectionRecreateCount;
160         }
161 
162         /**
163          * Gets the collectionRemoveCount.
164          * <p>
165          * @return Returns the collectionRemoveCount.
166          */
167         public long getCollectionRemoveCount() {
168             return this.collectionRemoveCount;
169         }
170 
171         /**
172          * Gets the collectionUpdateCount.
173          * <p>
174          * @return Returns the collectionUpdateCount.
175          */
176         public long getCollectionUpdateCount() {
177             return this.collectionUpdateCount;
178         }
179 
180         /**
181          * Gets the connectCount.
182          * <p>
183          * @return Returns the connectCount.
184          */
185         public long getConnectCount() {
186             return this.connectCount;
187         }
188 
189         /**
190          * Gets the entityDeleteCount.
191          * <p>
192          * @return Returns the entityDeleteCount.
193          */
194         public long getEntityDeleteCount() {
195             return this.entityDeleteCount;
196         }
197 
198         /**
199          * Gets the entityFetchCount.
200          * <p>
201          * @return Returns the entityFetchCount.
202          */
203         public long getEntityFetchCount() {
204             return this.entityFetchCount;
205         }
206 
207         /**
208          * Gets the entityInsertCount.
209          * <p>
210          * @return Returns the entityInsertCount.
211          */
212         public long getEntityInsertCount() {
213             return this.entityInsertCount;
214         }
215 
216         /**
217          * Gets the entityLoadCount.
218          * <p>
219          * @return Returns the entityLoadCount.
220          */
221         public long getEntityLoadCount() {
222             return this.entityLoadCount;
223         }
224 
225         /**
226          * Gets the entityUpdateCount.
227          * <p>
228          * @return Returns the entityUpdateCount.
229          */
230         public long getEntityUpdateCount() {
231             return this.entityUpdateCount;
232         }
233 
234         /**
235          * Gets the flushCount.
236          * <p>
237          * @return Returns the flushCount.
238          */
239         public long getFlushCount() {
240             return this.flushCount;
241         }
242 
243         /**
244          * Gets the optimisticFailureCount.
245          * <p>
246          * @return Returns the optimisticFailureCount.
247          */
248         public long getOptimisticFailureCount() {
249             return this.optimisticFailureCount;
250         }
251 
252         /**
253          * Gets the prepareStatementCount.
254          * <p>
255          * @return Returns the prepareStatementCount.
256          */
257         public long getPrepareStatementCount() {
258             return this.prepareStatementCount;
259         }
260 
261         /**
262          * Gets the queryCacheHitCount.
263          * <p>
264          * @return Returns the queryCacheHitCount.
265          */
266         public long getQueryCacheHitCount() {
267             return this.queryCacheHitCount;
268         }
269 
270         /**
271          * Gets the queryCacheMissCount.
272          * <p>
273          * @return Returns the queryCacheMissCount.
274          */
275         public long getQueryCacheMissCount() {
276             return this.queryCacheMissCount;
277         }
278 
279         /**
280          * Gets the queryCachePutCount.
281          * <p>
282          * @return Returns the queryCachePutCount.
283          */
284         public long getQueryCachePutCount() {
285             return this.queryCachePutCount;
286         }
287 
288         /**
289          * Gets the queryExecutionCount.
290          * <p>
291          * @return Returns the queryExecutionCount.
292          */
293         public long getQueryExecutionCount() {
294             return this.queryExecutionCount;
295         }
296 
297         /**
298          * Gets the queryExecutionMaxTime.
299          * <p>
300          * @return Returns the queryExecutionMaxTime.
301          */
302         public long getQueryExecutionMaxTime() {
303             return this.queryExecutionMaxTime;
304         }
305 
306         /**
307          * Gets the secondLevelCacheHitCount.
308          * <p>
309          * @return Returns the secondLevelCacheHitCount.
310          */
311         public long getSecondLevelCacheHitCount() {
312             return this.secondLevelCacheHitCount;
313         }
314 
315         /**
316          * Gets the secondLevelCacheMissCount.
317          * <p>
318          * @return Returns the secondLevelCacheMissCount.
319          */
320         public long getSecondLevelCacheMissCount() {
321             return this.secondLevelCacheMissCount;
322         }
323 
324         /**
325          * Gets the secondLevelCachePutCount.
326          * <p>
327          * @return Returns the secondLevelCachePutCount.
328          */
329         public long getSecondLevelCachePutCount() {
330             return this.secondLevelCachePutCount;
331         }
332 
333         /**
334          * Gets the sessionCloseCount.
335          * <p>
336          * @return Returns the sessionCloseCount.
337          */
338         public long getSessionCloseCount() {
339             return this.sessionCloseCount;
340         }
341 
342         /**
343          * Gets the sessionOpenCount.
344          * <p>
345          * @return Returns the sessionOpenCount.
346          */
347         public long getSessionOpenCount() {
348             return this.sessionOpenCount;
349         }
350 
351         /**
352          * Gets the successfulTransactionCount.
353          * <p>
354          * @return Returns the successfulTransactionCount.
355          */
356         public long getSuccessfulTransactionCount() {
357             return this.successfulTransactionCount;
358         }
359 
360         /**
361          * Gets the transactionCount.
362          * <p>
363          * @return Returns the transactionCount.
364          */
365         public long getTransactionCount() {
366             return this.transactionCount;
367         }
368 
369         /**
370          * Sets the closeStatementCount.
371          * <p>
372          * @param aCloseStatementCount The closeStatementCount to set.
373          */
374         public void setCloseStatementCount(long aCloseStatementCount) {
375             this.closeStatementCount = aCloseStatementCount;
376         }
377 
378         /**
379          * Sets the collectionFetchCount.
380          * <p>
381          * @param aCollectionFetchCount The collectionFetchCount to set.
382          */
383         public void setCollectionFetchCount(long aCollectionFetchCount) {
384             this.collectionFetchCount = aCollectionFetchCount;
385         }
386 
387         /**
388          * Sets the collectionLoadCount.
389          * <p>
390          * @param aCollectionLoadCount The collectionLoadCount to set.
391          */
392         public void setCollectionLoadCount(long aCollectionLoadCount) {
393             this.collectionLoadCount = aCollectionLoadCount;
394         }
395 
396         /**
397          * Sets the collectionRecreateCount.
398          * <p>
399          * @param aCollectionRecreateCount The collectionRecreateCount to set.
400          */
401         public void setCollectionRecreateCount(long aCollectionRecreateCount) {
402             this.collectionRecreateCount = aCollectionRecreateCount;
403         }
404 
405         /**
406          * Sets the collectionRemoveCount.
407          * <p>
408          * @param aCollectionRemoveCount The collectionRemoveCount to set.
409          */
410         public void setCollectionRemoveCount(long aCollectionRemoveCount) {
411             this.collectionRemoveCount = aCollectionRemoveCount;
412         }
413 
414         /**
415          * Sets the collectionUpdateCount.
416          * <p>
417          * @param aCollectionUpdateCount The collectionUpdateCount to set.
418          */
419         public void setCollectionUpdateCount(long aCollectionUpdateCount) {
420             this.collectionUpdateCount = aCollectionUpdateCount;
421         }
422 
423         /**
424          * Sets the connectCount.
425          * <p>
426          * @param aConnectCount The connectCount to set.
427          */
428         public void setConnectCount(long aConnectCount) {
429             this.connectCount = aConnectCount;
430         }
431 
432         /**
433          * Sets the entityDeleteCount.
434          * <p>
435          * @param aEntityDeleteCount The entityDeleteCount to set.
436          */
437         public void setEntityDeleteCount(long aEntityDeleteCount) {
438             this.entityDeleteCount = aEntityDeleteCount;
439         }
440 
441         /**
442          * Sets the entityFetchCount.
443          * <p>
444          * @param aEntityFetchCount The entityFetchCount to set.
445          */
446         public void setEntityFetchCount(long aEntityFetchCount) {
447             this.entityFetchCount = aEntityFetchCount;
448         }
449 
450         /**
451          * Sets the entityInsertCount.
452          * <p>
453          * @param aEntityInsertCount The entityInsertCount to set.
454          */
455         public void setEntityInsertCount(long aEntityInsertCount) {
456             this.entityInsertCount = aEntityInsertCount;
457         }
458 
459         /**
460          * Sets the entityLoadCount.
461          * <p>
462          * @param aEntityLoadCount The entityLoadCount to set.
463          */
464         public void setEntityLoadCount(long aEntityLoadCount) {
465             this.entityLoadCount = aEntityLoadCount;
466         }
467 
468         /**
469          * Sets the entityUpdateCount.
470          * <p>
471          * @param aEntityUpdateCount The entityUpdateCount to set.
472          */
473         public void setEntityUpdateCount(long aEntityUpdateCount) {
474             this.entityUpdateCount = aEntityUpdateCount;
475         }
476 
477         /**
478          * Sets the flushCount.
479          * <p>
480          * @param aFlushCount The flushCount to set.
481          */
482         public void setFlushCount(long aFlushCount) {
483             this.flushCount = aFlushCount;
484         }
485 
486         /**
487          * Sets the optimisticFailureCount.
488          * <p>
489          * @param aOptimisticFailureCount The optimisticFailureCount to set.
490          */
491         public void setOptimisticFailureCount(long aOptimisticFailureCount) {
492             this.optimisticFailureCount = aOptimisticFailureCount;
493         }
494 
495         /**
496          * Sets the prepareStatementCount.
497          * <p>
498          * @param aPrepareStatementCount The prepareStatementCount to set.
499          */
500         public void setPrepareStatementCount(long aPrepareStatementCount) {
501             this.prepareStatementCount = aPrepareStatementCount;
502         }
503 
504         /**
505          * Sets the queryCacheHitCount.
506          * <p>
507          * @param aQueryCacheHitCount The queryCacheHitCount to set.
508          */
509         public void setQueryCacheHitCount(long aQueryCacheHitCount) {
510             this.queryCacheHitCount = aQueryCacheHitCount;
511         }
512 
513         /**
514          * Sets the queryCacheMissCount.
515          * <p>
516          * @param aQueryCacheMissCount The queryCacheMissCount to set.
517          */
518         public void setQueryCacheMissCount(long aQueryCacheMissCount) {
519             this.queryCacheMissCount = aQueryCacheMissCount;
520         }
521 
522         /**
523          * Sets the queryCachePutCount.
524          * <p>
525          * @param aQueryCachePutCount The queryCachePutCount to set.
526          */
527         public void setQueryCachePutCount(long aQueryCachePutCount) {
528             this.queryCachePutCount = aQueryCachePutCount;
529         }
530 
531         /**
532          * Sets the queryExecutionCount.
533          * <p>
534          * @param aQueryExecutionCount The queryExecutionCount to set.
535          */
536         public void setQueryExecutionCount(long aQueryExecutionCount) {
537             this.queryExecutionCount = aQueryExecutionCount;
538         }
539 
540         /**
541          * Sets the queryExecutionMaxTime.
542          * <p>
543          * @param aQueryExecutionMaxTime The queryExecutionMaxTime to set.
544          */
545         public void setQueryExecutionMaxTime(long aQueryExecutionMaxTime) {
546             this.queryExecutionMaxTime = aQueryExecutionMaxTime;
547         }
548 
549         /**
550          * Sets the secondLevelCacheHitCount.
551          * <p>
552          * @param aSecondLevelCacheHitCount The secondLevelCacheHitCount to set.
553          */
554         public void setSecondLevelCacheHitCount(long aSecondLevelCacheHitCount) {
555             this.secondLevelCacheHitCount = aSecondLevelCacheHitCount;
556         }
557 
558         /**
559          * Sets the secondLevelCacheMissCount.
560          * <p>
561          * @param aSecondLevelCacheMissCount The secondLevelCacheMissCount to set.
562          */
563         public void setSecondLevelCacheMissCount(long aSecondLevelCacheMissCount) {
564             this.secondLevelCacheMissCount = aSecondLevelCacheMissCount;
565         }
566 
567         /**
568          * Sets the secondLevelCachePutCount.
569          * <p>
570          * @param aSecondLevelCachePutCount The secondLevelCachePutCount to set.
571          */
572         public void setSecondLevelCachePutCount(long aSecondLevelCachePutCount) {
573             this.secondLevelCachePutCount = aSecondLevelCachePutCount;
574         }
575 
576         /**
577          * Sets the sessionCloseCount.
578          * <p>
579          * @param aSessionCloseCount The sessionCloseCount to set.
580          */
581         public void setSessionCloseCount(long aSessionCloseCount) {
582             this.sessionCloseCount = aSessionCloseCount;
583         }
584 
585         /**
586          * Sets the sessionOpenCount.
587          * <p>
588          * @param aSessionOpenCount The sessionOpenCount to set.
589          */
590         public void setSessionOpenCount(long aSessionOpenCount) {
591             this.sessionOpenCount = aSessionOpenCount;
592         }
593 
594         /**
595          * Sets the successfulTransactionCount.
596          * <p>
597          * @param aSuccessfulTransactionCount The successfulTransactionCount to set.
598          */
599         public void setSuccessfulTransactionCount(long aSuccessfulTransactionCount) {
600             this.successfulTransactionCount = aSuccessfulTransactionCount;
601         }
602 
603         /**
604          * Sets the transactionCount.
605          * <p>
606          * @param aTransactionCount The transactionCount to set.
607          */
608         public void setTransactionCount(long aTransactionCount) {
609             this.transactionCount = aTransactionCount;
610         }
611 
612     }
613 
614     /**
615      * Class used to hold the property sheet descriptor info.
616      */
617     public static class BeanBeanInfo
618         extends BaseBeanInfo {
619 
620         public BeanBeanInfo() {
621             super(Bean.class);
622             ExtendedPropertyDescriptor descriptor = null;
623 
624             descriptor = addProperty("queryExecutionCount");
625             descriptor.setCategory(QUERY);
626             descriptor.setDisplayName("Query Execution Count");
627             descriptor.setShortDescription(Resources.getString("label.Numberofqueriesexecuted"));
628 
629             descriptor = addProperty("queryExecutionMaxTime");
630             descriptor.setCategory(QUERY);
631             descriptor.setDisplayName("Query Execution Max Time");
632             descriptor.setShortDescription(Resources.getString("label.Maximumamountoftime"));
633 
634             descriptor = addProperty("entityLoadCount");
635             descriptor.setCategory(ENTITY);
636             descriptor.setDisplayName("Entity Load Count");
637             descriptor.setShortDescription(Resources.getString("label.Numberofentitiesloaded"));
638 
639             descriptor = addProperty("entityInsertCount");
640             descriptor.setCategory(ENTITY);
641             descriptor.setDisplayName("Entity Insert Count");
642             descriptor.setShortDescription(Resources.getString("label.Numberofentitiesinserted"));
643 
644             descriptor = addProperty("entityUpdateCount");
645             descriptor.setCategory(ENTITY);
646             descriptor.setDisplayName("Entity Update Count");
647             descriptor.setShortDescription(Resources.getString("label.Numberofentitiesupdated"));
648 
649             descriptor = addProperty("entityDeleteCount");
650             descriptor.setCategory(ENTITY);
651             descriptor.setDisplayName("Entity Delete Count");
652             descriptor.setShortDescription(Resources.getString("label.Numberofentitiesdeleted"));
653 
654             descriptor = addProperty("entityFetchCount");
655             descriptor.setCategory(ENTITY);
656             descriptor.setDisplayName("Entity Fetch Count");
657             descriptor.setShortDescription(Resources.getString("label.Numberofentitiesfetched"));
658 
659             descriptor = addProperty("collectionFetchCount");
660             descriptor.setCategory(COLLECTIONS);
661             descriptor.setDisplayName("Collection Fetch Count");
662             descriptor.setShortDescription(Resources.getString("label.Numberofcollectionsfetched"));
663 
664             descriptor = addProperty("collectionLoadCount");
665             descriptor.setCategory(COLLECTIONS);
666             descriptor.setDisplayName("Collection Load Count");
667             descriptor.setShortDescription(Resources.getString("label.Numberofcollectionsloaded"));
668 
669             descriptor = addProperty("collectionRecreateCount");
670             descriptor.setCategory(COLLECTIONS);
671             descriptor.setDisplayName("Collection Recreate Count");
672             descriptor.setShortDescription(Resources.getString("label.Numberofcollectionsrecreated"));
673 
674             descriptor = addProperty("collectionRemoveCount");
675             descriptor.setCategory(COLLECTIONS);
676             descriptor.setDisplayName("Collection Removed Count");
677             descriptor.setShortDescription(Resources.getString("label.Numberofcollectionsremoved"));
678 
679             descriptor = addProperty("collectionUpdateCount");
680             descriptor.setCategory(COLLECTIONS);
681             descriptor.setDisplayName("Collection Update Count");
682             descriptor.setShortDescription(Resources.getString("label.Numberofcollectionsupdated"));
683 
684             descriptor = addProperty("secondLevelCachePutCount");
685             descriptor.setCategory(CACHE);
686             descriptor.setDisplayName("Second Level Cache Puts");
687             descriptor.setShortDescription(Resources.getString("label.Numberofcacheputs"));
688 
689             descriptor = addProperty("secondLevelCacheHitCount");
690             descriptor.setCategory(CACHE);
691             descriptor.setDisplayName("Second Level Cache Hits");
692             descriptor.setShortDescription(Resources.getString("label.Numberofcachehits"));
693 
694             descriptor = addProperty("secondLevelCacheMissCount");
695             descriptor.setCategory(CACHE);
696             descriptor.setDisplayName("Second Level Cache Misses");
697             descriptor.setShortDescription(Resources.getString("label.Numberofcachemisses"));
698 
699             descriptor = addProperty("queryCachePutCount");
700             descriptor.setCategory(CACHE);
701             descriptor.setDisplayName("Query Cache Puts");
702             descriptor.setShortDescription(Resources.getString("label.Numberofquerycacheputs"));
703 
704             descriptor = addProperty("queryCacheHitCount");
705             descriptor.setCategory(CACHE);
706             descriptor.setDisplayName("Query Cache Hits");
707             descriptor.setShortDescription(Resources.getString("label.Numberofquerycachehits"));
708 
709             descriptor = addProperty("queryCacheMissCount");
710             descriptor.setCategory(CACHE);
711             descriptor.setDisplayName("Query Cache Misses");
712             descriptor.setShortDescription(Resources.getString("label.Numberofquerycachemisses"));
713 
714             descriptor = addProperty("sessionOpenCount");
715             descriptor.setCategory(SESSION);
716             descriptor.setDisplayName("Sessions Opened");
717             descriptor.setShortDescription(Resources.getString("label.Numberofsessionsopened"));
718 
719             descriptor = addProperty("sessionCloseCount");
720             descriptor.setCategory(SESSION);
721             descriptor.setDisplayName("Sessions Closed");
722             descriptor.setShortDescription(Resources.getString("label.Numberofsessionsclosed"));
723 
724             descriptor = addProperty("flushCount");
725             descriptor.setCategory(SESSION);
726             descriptor.setDisplayName("Flushes");
727             descriptor.setShortDescription(Resources.getString("label.Numberofsessionsflushed"));
728 
729             descriptor = addProperty("connectCount");
730             descriptor.setCategory(SESSION);
731             descriptor.setDisplayName("Connections");
732             descriptor.setShortDescription(Resources.getString("label.Numberofsessionsconnections"));
733 
734             descriptor = addProperty("prepareStatementCount");
735             descriptor.setCategory(SESSION);
736             descriptor.setDisplayName("Prepared Statements");
737             descriptor.setShortDescription(Resources.getString("label.Numberofsessionpreparedstatements"));
738 
739             descriptor = addProperty("closeStatementCount");
740             descriptor.setCategory(SESSION);
741             descriptor.setDisplayName("Closed Statements");
742             descriptor.setShortDescription(Resources.getString("label.Numberofsessionclosedstatements"));
743 
744             descriptor = addProperty("successfulTransactionCount");
745             descriptor.setCategory(TRANSACTION);
746             descriptor.setDisplayName("Successful Transactions");
747             descriptor.setShortDescription(Resources.getString("label.Numberofsuccessfultransactions"));
748 
749             descriptor = addProperty("transactionCount");
750             descriptor.setCategory(TRANSACTION);
751             descriptor.setDisplayName("Transactions");
752             descriptor.setShortDescription(Resources.getString("label.Numberoftransactions"));
753 
754             descriptor = addProperty("optimisticFailureCount");
755             descriptor.setCategory(TRANSACTION);
756             descriptor.setDisplayName("Optimistic Lock Failures");
757             descriptor.setShortDescription(Resources.getString("label.Numberoffailedoptimisticlocks"));
758         }
759     }
760 
761 }