KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > connectors > inflow > monitor > ConnectorEndPointFactoryStatsImpl


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.connectors.inflow.monitor;
25
26 import com.sun.enterprise.admin.monitor.stats.ConnectorEndPointFactoryStats;
27 import com.sun.enterprise.admin.monitor.stats.CountStatisticImpl;
28 import com.sun.enterprise.admin.monitor.stats.GenericStatsImpl;
29 import com.sun.enterprise.admin.monitor.stats.MutableCountStatisticImpl;
30 import com.sun.enterprise.resource.monitor.AbstractStatsImpl;
31
32 import com.sun.logging.LogDomains;
33
34 import java.util.logging.Level JavaDoc;
35 import java.util.logging.Logger JavaDoc;
36
37 import javax.management.j2ee.statistics.CountStatistic JavaDoc;
38
39 /**
40  * This class provides an implementation of the JDBCConnectionPoolStats
41  * interface. The implementations of the interface methods primarily delegate the
42  * task of statistic gathering to the work-manager of the inbound resource
43  * adapter
44  * @author Sivakumar Thyagarajan
45  */

46 public class ConnectorEndPointFactoryStatsImpl extends AbstractStatsImpl
47                                         implements ConnectorEndPointFactoryStats {
48
49     private static Logger JavaDoc _logger =
50                 LogDomains.getLogger( LogDomains.RSR_LOGGER );
51     private GenericStatsImpl gsImpl;
52     
53     private CountStatistic JavaDoc endPointsCreatedCount;
54     private CountStatistic JavaDoc messagesDeliveredCount;
55     private CountStatistic JavaDoc runTimeExceptionsCount;
56
57     //@discuss: should this be for a bean-id combination?
58
public ConnectorEndPointFactoryStatsImpl() {
59         initializeStatistics();
60         try {
61             gsImpl = new GenericStatsImpl(
62             this.getClass().getInterfaces()[0].getName(), this );
63             } catch( ClassNotFoundException JavaDoc cnfe ) {
64             //@todo:add to reosurces file
65
_logger.log( Level.INFO, "endpointfacmon.cnfe", "GenericStatsImpl" );
66             }
67     }
68     
69
70     private void initializeStatistics() {
71         long time = System.currentTimeMillis();
72         CountStatistic JavaDoc cs = null;
73     
74         cs = new CountStatisticImpl(0,
75             "endPointsCreated", "",
76         "The number of endpoints created using this endpoint factory"
77             ,time, time);
78         endPointsCreatedCount = new MutableCountStatisticImpl( cs );
79
80         cs = new CountStatisticImpl(0, "messagesDelivered", "",
81                     "The number of messages delivered to endpoints created using this " +
82                     "endpoint factory",time, time);
83         messagesDeliveredCount = new MutableCountStatisticImpl( cs );
84
85         cs = new CountStatisticImpl(0, "runtimeExceptionCount", "",
86                     "The number of runtime exceptions thown by endpoints created" +
87                     "by this end point factory",time, time);
88         runTimeExceptionsCount = new MutableCountStatisticImpl( cs );
89     }
90
91
92     /* (non-Javadoc)
93      * @see com.sun.enterprise.admin.monitor.stats.ConnectorEndPointFactoryStats#getMessagesCreatedCount()
94      */

95     public CountStatistic JavaDoc getMessagesCreatedCount() {
96         //@todo to implement
97
return null;
98     }
99
100
101     /* (non-Javadoc)
102      * @see com.sun.enterprise.admin.monitor.stats.ConnectorEndPointFactoryStats#getDeliveredMessageCount()
103      */

104     public CountStatistic JavaDoc getDeliveredMessageCount() {
105         //@todo to implement
106
return null;
107     }
108
109
110     /* (non-Javadoc)
111      * @see com.sun.enterprise.admin.monitor.stats.ConnectorEndPointFactoryStats#getRuntimeExceptionsCount()
112      */

113     public CountStatistic JavaDoc getRuntimeExceptionsCount() {
114         //@todo to implement
115
return null;
116     }
117 }
118
Popular Tags