KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > common > jmx > mbeans > DataCollectorMBean


1 /**
2  * C-JDBC: Clustered JDBC.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: c-jdbc@objectweb.org
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU Lesser General Public License as published by the
9  * Free Software Foundation; either version 2.1 of the License, or any later
10  * version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20  *
21  * Initial developer(s): Nicolas Modrzyk.
22  * Contributor(s):
23  */

24
25 package org.objectweb.cjdbc.common.jmx.mbeans;
26
27 import org.objectweb.cjdbc.common.exceptions.DataCollectorException;
28 import org.objectweb.cjdbc.common.monitor.AbstractDataCollector;
29
30 /**
31  * DataCollector interface to used via JMX. This interface defines the entry
32  * point to collect dynamic data for all c-jdbc components.
33  *
34  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
35  */

36 public interface DataCollectorMBean
37 {
38
39   // ****************************************//
40
// *************** Controller Data ********//
41
// ****************************************//
42

43   /**
44    * Get general information on the load of the controller. Get the number of
45    * threads and total memory used up
46    *
47    * @throws DataCollectorException if collection of information fails
48    * @return array of strings
49    */

50   String JavaDoc[][] retrieveControllerLoadData() throws DataCollectorException;
51
52   /**
53    * Get dynamic data of the different virtual databases, like pending
54    * connections size, currentNb of threads and number of active threads.
55    *
56    * @throws DataCollectorException if collection of information fails
57    * @return array of strings
58    */

59   String JavaDoc[][] retrieveVirtualDatabasesData() throws DataCollectorException;
60
61   /**
62    * Try to see if a virtual database exists from its name
63    *
64    * @param name of the virtual database
65    * @return true if exists, false otherwise
66    */

67   boolean hasVirtualDatabase(String JavaDoc name);
68
69   // ****************************************//
70
// *************** Database Data **********//
71
// ****************************************//
72

73   /**
74    * Get the current SQL statistics for all databases
75    *
76    * @throws DataCollectorException if collection of information fails
77    * @return the statistics
78    */

79   String JavaDoc[][] retrieveSQLStats() throws DataCollectorException;
80
81   /**
82    * Get the current cache content for all databases
83    *
84    * @throws DataCollectorException if collection of information fails
85    * @return the cache content
86    */

87   String JavaDoc[][] retrieveCacheData() throws DataCollectorException;
88
89   /**
90    * Get the current cache stats content for all databases
91    *
92    * @throws DataCollectorException if collection of information fails
93    * @return the cache stats content
94    */

95   String JavaDoc[][] retrieveCacheStatsData() throws DataCollectorException;
96
97   /**
98    * Get the current list of backends data for all databases
99    *
100    * @throws DataCollectorException if collection of information fails
101    * @return the backend list content
102    */

103   String JavaDoc[][] retrieveBackendsData() throws DataCollectorException;
104
105   /**
106    * Get the current list of current users and associated data for all databases
107    *
108    * @throws DataCollectorException if collection of information fails
109    * @return data on users
110    */

111   String JavaDoc[][] retrieveClientsData() throws DataCollectorException;
112
113   /**
114    * Get the current SQL statistics
115    *
116    * @param virtualDatabasename of the database to get the data from
117    * @return the statistics
118    * @throws DataCollectorException if collection of information fails
119    */

120   String JavaDoc[][] retrieveSQLStats(String JavaDoc virtualDatabasename)
121       throws DataCollectorException;
122
123   /**
124    * Get the current cache content
125    *
126    * @param virtualDatabasename of the database to get the data from
127    * @return the cache content
128    * @throws DataCollectorException if collection of information fails
129    */

130   String JavaDoc[][] retrieveCacheData(String JavaDoc virtualDatabasename)
131       throws DataCollectorException;
132
133   /**
134    * Get the current cache stats content
135    *
136    * @param virtualDatabasename of the database to get the data from
137    * @return the cache stats content
138    * @throws DataCollectorException if collection of information fails
139    */

140   String JavaDoc[][] retrieveCacheStatsData(String JavaDoc virtualDatabasename)
141       throws DataCollectorException;
142
143   /**
144    * Get the current list of backends data
145    *
146    * @param virtualDatabasename of the database to get the data from
147    * @return the backend list content
148    * @throws DataCollectorException if collection of information fails
149    */

150   String JavaDoc[][] retrieveBackendsData(String JavaDoc virtualDatabasename)
151       throws DataCollectorException;
152
153   /**
154    * Retrive information about the scheduler, like number of pending requests,
155    * number of writes executed and number of read executed
156    *
157    * @param virtualDatabasename of the database to get the data from
158    * @return data on the associated scheduler
159    * @throws DataCollectorException if collection of data fails
160    */

161   String JavaDoc[][] retrieveSchedulerData(String JavaDoc virtualDatabasename)
162       throws DataCollectorException;
163
164   /**
165    * Get the current list of current users and associated data
166    *
167    * @param virtualDatabasename of the database to get the data from
168    * @return data on users
169    * @throws DataCollectorException if collection of information fails
170    */

171   String JavaDoc[][] retrieveClientsData(String JavaDoc virtualDatabasename)
172       throws DataCollectorException;
173
174   // ****************************************//
175
// *************** Fine grain Data ********//
176
// ****************************************//
177
/**
178    * Get some data information on a fine grain approach
179    *
180    * @param collector for the data to be accessed
181    * @return <code>long</code> value of the data
182    * @throws DataCollectorException if collection of information fails
183    */

184   long retrieveData(AbstractDataCollector collector)
185       throws DataCollectorException;
186
187   /**
188    * Get starting point for exchanging data on a particular target
189    *
190    * @param dataType as given in the DataCollection interface
191    * @param targetName if needed (like backendname,clientName ...)
192    * @param virtualDbName if needed
193    * @return collector instance
194    * @throws DataCollectorException if fails to get proper collector instance
195    * @see org.objectweb.cjdbc.common.monitor.DataCollection
196    */

197   AbstractDataCollector retrieveDataCollectorInstance(int dataType,
198       String JavaDoc targetName, String JavaDoc virtualDbName) throws DataCollectorException;
199
200   /**
201    * Gets content data of the recovery log
202    *
203    * @param databaseName the virtual database name
204    * @return data on the recovery log
205    * @throws DataCollectorException if collection of information fails
206    */

207   String JavaDoc[][] retrieveRecoveryLogData(String JavaDoc databaseName) throws DataCollectorException;
208
209 }
Popular Tags