KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > common > jmx > monitoring > AbstractDataCollector


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Contact: sequoia@continuent.org
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  * Initial developer(s): Nicolas Modrzyk.
20  * Contributor(s):
21  */

22
23 package org.continuent.sequoia.common.jmx.monitoring;
24
25 import java.io.Serializable JavaDoc;
26
27 import org.continuent.sequoia.common.exceptions.DataCollectorException;
28
29 /**
30  * This defines the abstract hierachy to collect monitoring information. All
31  * monitored information from the controller should extends this class.
32  * <code>collectValue</code> can therefore NOT be called directly on the
33  * client side. Instead, the client should be only given the returned result.
34  *
35  * @author <a HREF="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk</a>
36  */

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

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

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

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

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