001: /*
002: * MCS Media Computer Software Copyright (c) 2005 by MCS
003: * -------------------------------------- Created on 23.04.2005 by w.klaas
004: *
005: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
006: * use this file except in compliance with the License. You may obtain a copy of
007: * the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014: * License for the specific language governing permissions and limitations under
015: * the License.
016: */
017: package de.mcs.jmeasurement;
018:
019: import java.io.Serializable;
020:
021: /**
022: * The MeasurePoint is one point in the code for measuring. All measure points
023: * will be organized in an hirachical tree. The MeasurePoint is responsible for
024: * holding all informations about the measuring for this point. It will control
025: * the instancing and disposing of the monitors for this point. All methodes of
026: * an concret class must be implementet threadsafe.
027: *
028: * @author w.klaas
029: */
030: public interface MeasurePoint extends Serializable {
031:
032: /**
033: * @return Monitor getting a new monitor for this measure point
034: */
035: Monitor getMonitor();
036:
037: /**
038: * @return Monitor Getting an monitor for this measurepoint and start it.
039: */
040: Monitor start();
041:
042: /**
043: * @return String Fully qualified name of this MeasurePoint.
044: */
045: String getName();
046:
047: /**
048: * @return int Getting the priority of this MeasurePoint
049: */
050: int getPriority();
051:
052: /**
053: * @param priority
054: * Setting the priority of this MeasurePoint
055: */
056: void setPriority(int priority);
057:
058: /**
059: * getting all data of this measurement point.
060: *
061: * @return Array of MeasureData objects
062: */
063: MeasureData[] getData();
064:
065: /**
066: * call back, to adding the monitor values to the measure point.
067: *
068: * @param monitor
069: * the monitor to add the values to
070: */
071: void processMonitor(Monitor monitor);
072:
073: /**
074: * call back, to add a monitor as a death monitor.
075: *
076: * @param monitor
077: * the monitor to add
078: */
079: void deathMonitor(Monitor monitor);
080:
081: /**
082: * @return Returns the userData.
083: */
084: IUserData getUserData();
085:
086: /**
087: * @param userData
088: * The userData to set.
089: */
090: void setUserData(IUserData userData);
091:
092: /**
093: * Adding datas from outside.
094: *
095: * @param datas
096: * the MeasureData list to add
097: */
098: void setData(MeasureData[] datas);
099:
100: /**
101: * @return Returns the measureDataCallback.
102: */
103: MeasureDataCallback getMeasureDataCallback();
104:
105: /**
106: * @param aMeasureDataCallback
107: * The measureDataCallback to set.
108: */
109: void setMeasureDataCallback(
110: final MeasureDataCallback aMeasureDataCallback);
111:
112: /**
113: * Getting the data with the name name.
114: *
115: * @param name
116: * name of the data to get
117: * @return MeasureData
118: */
119: MeasureData getData(String name);
120:
121: /**
122: * getting the class of a point data from the name.
123: *
124: * @param name
125: * name of the data
126: * @return Class
127: */
128: Class getDataClass(String name);
129:
130: /**
131: * Getting the measurement data as simple string.
132: *
133: * @return String with a key=value list of all measurement data
134: */
135: String asString();
136:
137: /**
138: * This callback is for a monitor that has been activatet via start()
139: * methode.
140: *
141: * @param monitor
142: * the monitor that has been activated
143: */
144: void activateMonitor(Monitor monitor);
145:
146: /**
147: * cloning this measure point.
148: *
149: * @return new measure point
150: */
151: Object clone();
152:
153: /**
154: * just increase the counter.
155: *
156: * @return the actual count.
157: */
158: long increaseCount();
159:
160: /**
161: * @return <code>true</code> if this measurepoint has active monitors,
162: * that are currently running.
163: */
164: boolean hasActiveMonitors();
165: }
|