01: /**
02: * Sequoia: Database clustering technology.
03: * Copyright (C) 2002-2004 French National Institute For Research In Computer
04: * Science And Control (INRIA).
05: * Contact: sequoia@continuent.org
06: *
07: * Licensed under the Apache License, Version 2.0 (the "License");
08: * you may not use this file except in compliance with the License.
09: * 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: */package org.continuent.sequoia.common.jmx.monitoring;
22:
23: import java.io.Serializable;
24:
25: import org.continuent.sequoia.common.exceptions.DataCollectorException;
26:
27: /**
28: * This defines the abstract hierachy to collect monitoring information. All
29: * monitored information from the controller should extends this class.
30: * <code>collectValue</code> can therefore NOT be called directly on the
31: * client side. Instead, the client should be only given the returned result.
32: *
33: * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk</a>
34: */
35: public abstract class AbstractDataCollector implements Serializable {
36: protected transient Object controller;
37:
38: /**
39: * This is used on the controller side to collect information
40: *
41: * @return the value collected by this collectorsardes@inrialpes.fr
42: * @throws DataCollectorException if fails to collect the information
43: */
44: public abstract long collectValue() throws DataCollectorException;
45:
46: /**
47: * Get a string description for this collector
48: *
49: * @return translated string
50: */
51: public abstract String getDescription();
52:
53: /**
54: * Return the name of the target of this collector
55: *
56: * @return target name
57: */
58: public abstract String getTargetName();
59:
60: /**
61: * associated a controller to this data collector
62: *
63: * @param controller to associate
64: */
65: public void setController(Object controller) {
66: this.controller = controller;
67: }
68:
69: }
|