All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.mcs.jmeasurement.MeasurePoint Maven / Gradle / Ivy

There is a newer version: 1.1.226
Show newest version
/*
 * MCS Media Computer Software Copyright (c) 2005 by MCS
 * -------------------------------------- Created on 23.04.2005 by w.klaas
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package de.mcs.jmeasurement;

import java.io.Serializable;

/**
 * The MeasurePoint is one point in the code for measuring. All measure points
 * will be organized in an hirachical tree. The MeasurePoint is responsible for
 * holding all informations about the measuring for this point. It will control
 * the instancing and disposing of the monitors for this point. All methodes of
 * an concret class must be implementet threadsafe.
 * 
 * @author w.klaas
 */
public interface MeasurePoint extends Serializable {

  public static enum PRIORITY {
    LOWEST, LOW, MEDIUM, HIGH, HIGHEST
  };

  /**
   * @return Monitor getting a new monitor for this measure point
   */
  Monitor getMonitor();

  /**
   * @return Monitor Getting an monitor for this measurepoint and start it.
   */
  Monitor start();

  /**
   * @return String Fully qualified name of this MeasurePoint.
   */
  String getName();

  /**
   * @return int Getting the priority of this MeasurePoint
   */
  PRIORITY getPriority();

  /**
   * @param priority
   *            Setting the priority of this MeasurePoint
   */
  void setPriority(PRIORITY priority);

  /**
   * getting all data of this measurement point.
   * 
   * @return Array of MeasureData objects
   */
  MeasureData[] getData();

  /**
   * call back, to adding the monitor values to the measure point.
   * 
   * @param monitor
   *            the monitor to add the values to
   */
  void processMonitor(Monitor monitor);

  /**
   * call back, to add a monitor as a death monitor.
   * 
   * @param monitor
   *            the monitor to add
   */
  void deathMonitor(Monitor monitor);

  /**
   * @return Returns the userData.
   */
  IUserData getUserData();

  /**
   * @param userData
   *            The userData to set.
   */
  void setUserData(IUserData userData);

  /**
   * Adding datas from outside.
   * 
   * @param datas
   *            the MeasureData list to add
   */
  void setData(MeasureData[] datas);

  /**
   * @return Returns the measureDataCallback.
   */
  MeasureDataCallback getMeasureDataCallback();

  /**
   * @param aMeasureDataCallback
   *            The measureDataCallback to set.
   */
  void setMeasureDataCallback(final MeasureDataCallback aMeasureDataCallback);

  /**
   * Getting the data with the name name.
   * 
   * @param name
   *            name of the data to get
   * @return MeasureData
   */
  MeasureData getData(String name);

  /**
   * getting the class of a point data from the name.
   * 
   * @param name
   *            name of the data
   * @return Class
   */
  Class getDataClass(String name);

  /**
   * Getting the measurement data as simple string.
   * 
   * @return String with a key=value list of all measurement data
   */
  String asString();

  /**
   * This callback is for a monitor that has been activatet via start()
   * methode.
   * 
   * @param monitor
   *            the monitor that has been activated
   */
  void activateMonitor(Monitor monitor);

  /**
   * cloning this measure point.
   * 
   * @return new measure point
   */
  Object clone();

  /**
   * just increase the counter.
   * 
   * @return the actual count.
   */
  long increaseCount();

  /**
   * @return true if this measurepoint has active monitors,
   *         that are currently running.
   */
  boolean hasActiveMonitors();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy