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