KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > cjdbc > common > monitor > AbstractDataCollector


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.monitor;
26
27 import java.io.Serializable JavaDoc;
28
29 import org.objectweb.cjdbc.common.exceptions.DataCollectorException;
30
31 /**
32  * This defines the abstract hierachy to collect monitoring information. All
33  * monitored information from the controller should extends this class.
34  * <code>collectValue</code> can therefore NOT be called directly on the
35  * client side. Instead, the client should be only given the returned result.
36  *
37  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk</a>
38  */

39 public abstract class AbstractDataCollector implements Serializable JavaDoc
40 {
41   protected transient Object JavaDoc controller;
42
43   /**
44    * This is used on the controller side to collect information
45    *
46    * @return the value collected by this collectorsardes@inrialpes.fr
47    * @throws DataCollectorException if fails to collect the information
48    */

49   public abstract long collectValue() throws DataCollectorException;
50
51   /**
52    * Get a string description for this collector
53    *
54    * @return translated string
55    */

56   public abstract String JavaDoc getDescription();
57
58   /**
59    * Return the name of the target of this collector
60    *
61    * @return target name
62    */

63   public abstract String JavaDoc getTargetName();
64
65   /**
66    * associated a controller to this data collector
67    *
68    * @param controller to associate
69    */

70   public void setController(Object JavaDoc controller)
71   {
72     this.controller = controller;
73   }
74
75 }
76
Popular Tags