| java.lang.Object de.mcs.jmeasurement.MeasureFactory
MeasureFactory | final public class MeasureFactory (Code) | | This is the main entry point into the measurement system.
author: w.klaas |
Inner Class :static class MeasureTask extends TimerTask | |
Method Summary | |
public static String | asString() This is the standard report feature with all Points as an text Report. | public static void | clear() Clearing all measure data and measure points. | public static boolean | configure() load configuration from jmconfig.properties file in the classpath. | public static boolean | configure(File jmConfig) load configuration from the given properties file.
Parameters: jmConfig - the config file to load. | public static String | getApplicationName() Returns the applicationName. | public static JMConfig | getConfig() | public static int | getExceptionHandling() | public static MeasureDataCallback | getMeasureDataCallback() Returns the measureDataCallback object. | public static MeasurePoint | getMeasurePoint(String pointName) getting the desired measurement point. | public static String[] | getMeasurePointNames(String pointName) getting an array of measurement point names. | public static MeasurePoint[] | getMeasurePoints(String pointName) getting an array of measurement points. | public static Monitor | getMonitor(String pointName) Getting a new monitor for the measurement point pointName. | public static int | getPriority() Return the actual priority setting of the factory. | public static String | getReport(MeasureDataRenderer renderer) Getting a rendered report of the measure data. | public static String | getReport(String pointname, MeasureDataRenderer renderer) Getting a rendered report of the measure data. | public static void | getReport(String pointname, MeasureDataRenderer renderer, Writer output) Getting a rendered report of the measure data. | public static SnapShot | getSnapShot(String snapshotname) getting a snapshot from the system. | public static String[] | getSnapShotNames() getting the names of all snapshots from the system. | public static boolean | isBackgroundProcessing() testing if backgorund processing is enabled. | public static boolean | isEnable() Returns if this factory can deliver monitors or not. | public static void | loadFromXMLFile(String filename, boolean loadSnapShotData) Load the measurepoints from an external XML file. | public static void | loadFromXMLStream(InputStream stream, boolean loadSnapShotData) Load the measurepoints with data from an inputstream. | public static Object | registerInterface(Object object) Adding a Interface for automatic methode measurement. | public static Object | registerInterface(Object object, String[] aMethodNames) Adding a Interface for automatic methode measurement. | public static Object | registerInterface(Object object, boolean storeExceptions, boolean fullExceptions) Adding a Interface for automatic methode measurement. | public static Object | registerInterface(Object object, boolean storeExceptions, boolean fullExceptions, String[] aMethodNames) Adding a Interface for automatic methode measurement.
Parameters: object - Interface to add Parameters: storeExceptions - if the exception stacktraces should be stored. Parameters: fullExceptions - full exceptions with stacktraces Parameters: aMethodNames - list with all methodnames that should be monitored. | public static void | registerMBeans() registering the JMX extensions for JMeasurement in the standard MBean
server of this platform. | public static SnapShot | removeSnapShot(String snapshotname) removing a snapshot from the system. | public static void | saveSnapShot(SnapShot snapshot, File file) save snapshot as XMl. | public static void | saveToXMLFile(String filename) saving all measurementpoints to an xml file structure for later reloading
with loadFromXMLFile() . | public static void | saveToXMLStream(OutputStream stream) saving all measurementpoints to an xml file structure for later
reloading. | public static void | setApplicationName(String aApplicationName) Setting the application name. | public static void | setBackgroundProcessing(boolean enableBackground) starting and stopping background processing. | public static void | setEnable(boolean aEnable) This methode will enable the monitor factory. | public static void | setExceptionHandling(int aExceptionHandling) setting the value of the exception handling. | public static void | setMeasureDataCallback(MeasureDataCallback aMeasureDataCallback) setting the measureDataCallback object. | public static void | setOption(String aOptionName, String aOptionValue) setting some special options for this factory. | public static void | setOptions(Map<String, String> aOptions) Setting a bunch of options. | public static void | setPriority(int aPriority) Setting the actual priority of the factory. | public static Monitor | start(String pointName) Getting a new monitor for the measurement point pointName and starting
this monitor. | public static SnapShot | takeSnapshot(String snapshotname) new methode for making a snapshot. |
XMLATT_APPNAME | final static String XMLATT_APPNAME(Code) | | constants for xml writing and reading.
|
XMLATT_CLASS | final static String XMLATT_CLASS(Code) | | constants for xml writing and reading.
|
XMLATT_CREATED | final static String XMLATT_CREATED(Code) | | constants for xml writing and reading.
|
XMLATT_NAME | final static String XMLATT_NAME(Code) | | constants for xml writing and reading.
|
XMLATT_VALUE | final static String XMLATT_VALUE(Code) | | constants for xml writing and reading.
|
XMLNODE_MEASUREPOINTS | final static String XMLNODE_MEASUREPOINTS(Code) | | constants for xml writing and reading.
|
XMLNODE_POINT | final static String XMLNODE_POINT(Code) | | constants for xml writing and reading.
|
XMLNODE_PROPERTY | final static String XMLNODE_PROPERTY(Code) | | constants for xml writing and reading.
|
XMLNODE_ROOT | final static String XMLNODE_ROOT(Code) | | constants for xml writing and reading.
|
XMLNODE_SNAPSHOT | final static String XMLNODE_SNAPSHOT(Code) | | constants for xml writing and reading.
|
XMLNODE_SNAPSHOTS | final static String XMLNODE_SNAPSHOTS(Code) | | constants for xml writing and reading.
|
asString | public static String asString()(Code) | | This is the standard report feature with all Points as an text Report.
the string representation of this measurement factory |
clear | public static void clear()(Code) | | Clearing all measure data and measure points.
|
configure | public static boolean configure()(Code) | | load configuration from jmconfig.properties file in the classpath.
true if the file could be loaded, otherwisefalse . |
configure | public static boolean configure(File jmConfig)(Code) | | load configuration from the given properties file.
Parameters: jmConfig - the config file to load. true if the file could be loaded, otherwisefalse . |
getApplicationName | public static String getApplicationName()(Code) | | Returns the applicationName.
String Returns the applicationName. |
getConfig | public static JMConfig getConfig()(Code) | | getting the actual config object. |
getExceptionHandling | public static int getExceptionHandling()(Code) | | value of exception handling |
getMeasureDataCallback | public static MeasureDataCallback getMeasureDataCallback()(Code) | | Returns the measureDataCallback object.
Returns the measureDataCallback. |
getMeasurePoint | public static MeasurePoint getMeasurePoint(String pointName)(Code) | | getting the desired measurement point. If it doesn't exists it will be
created.
Parameters: pointName - name of the desired point (fully qualified) MeasurePoint the desired MeasurePoint |
getMeasurePointNames | public static String[] getMeasurePointNames(String pointName)(Code) | | getting an array of measurement point names. The pointname is a regular
expression of the desired points.
Parameters: pointName - regular expression of the desired point names (or null for allpoints) String[] the desired MeasurePointNames |
getMeasurePoints | public static MeasurePoint[] getMeasurePoints(String pointName)(Code) | | getting an array of measurement points. The pointname is a regular
expression of the desired points.
Parameters: pointName - regular expression of the desired point names (or null for allpoints) MeasurePoint[] the desired MeasurePoints |
getMonitor | public static Monitor getMonitor(String pointName)(Code) | | Getting a new monitor for the measurement point pointName. If the point
doesn't exists, it wil be created.
Parameters: pointName - name of the measurement point to use. Monitor |
getPriority | public static int getPriority()(Code) | | Return the actual priority setting of the factory.
Returns the priority. |
getReport | public static String getReport(String pointname, MeasureDataRenderer renderer) throws RendererMustNotBeNullException(Code) | | Getting a rendered report of the measure data. The points in the
requested report will be evaluating with the point string. To get some
report the renderer must be given. If not,
RendererMustNotBeNullException will be thrown.
Parameters: pointname - regular expression to match the point names (or null for allpoints) Parameters: renderer - the renderer to use for this report a string with the report throws: RendererMustNotBeNullException - thrown, if the renderer is not set. |
getReport | public static void getReport(String pointname, MeasureDataRenderer renderer, Writer output) throws RendererMustNotBeNullException, IOException(Code) | | Getting a rendered report of the measure data. The points in the
requested report will be evaluating with the point string. To get some
report the renderer must be given. If not,
RendererMustNotBeNullException will be thrown.
Parameters: pointname - regular expression to match the point names (or null for allpoints) Parameters: renderer - the renderer to use for this report Parameters: output - the writer to output the report throws: RendererMustNotBeNullException - thrown, if the renderer is not set. throws: IOException - if something goes wrong with the writer IO operation. |
getSnapShot | public static SnapShot getSnapShot(String snapshotname)(Code) | | getting a snapshot from the system.
Parameters: snapshotname - name of the snapshot to get the desired snapshot or null if no snapshot withthis name is present. |
getSnapShotNames | public static String[] getSnapShotNames()(Code) | | getting the names of all snapshots from the system.
String[] array with all snapshot names . |
isBackgroundProcessing | public static boolean isBackgroundProcessing()(Code) | | testing if backgorund processing is enabled.
true if background processing is enabled,otherwise false since: 0.68 |
isEnable | public static boolean isEnable()(Code) | | Returns if this factory can deliver monitors or not.
boolean true if this factory can deliver monitorsor false . |
loadFromXMLStream | public static void loadFromXMLStream(InputStream stream, boolean loadSnapShotData) throws IOException, SAXException, MeasurementException(Code) | | Load the measurepoints with data from an inputstream.
Parameters: stream - InputStream to load the measure data from Parameters: loadSnapShotData - loading the snapshot data if present. throws: IOException - if something goes wrong with reading of the desired xmlstream throws: SAXException - if something goes wrong with reading of the desired xmlstream throws: MeasurementException - if something goes wrong |
registerInterface | public static Object registerInterface(Object object)(Code) | | Adding a Interface for automatic methode measurement. Exception handling
as defined here.
Parameters: object - Interface to add the interface to the proxy class. since: 0.66 |
registerInterface | public static Object registerInterface(Object object, String[] aMethodNames)(Code) | | Adding a Interface for automatic methode measurement. Exception handling
as defined here.
Parameters: object - Interface to add Parameters: aMethodNames - names of the methodes to monitor. null if allmethodes should be monitored. since: 0.72 If you wan't to define an argument as a point name you can since: use the following syntax for the method name: <method since: name>[.arg<index of argument>] the interface to the proxy class. since: 0.66 |
registerInterface | public static Object registerInterface(Object object, boolean storeExceptions, boolean fullExceptions)(Code) | | Adding a Interface for automatic methode measurement.
Parameters: object - Interface to add Parameters: storeExceptions - if the exception stacktraces should be stored. Parameters: fullExceptions - full exceptions with stacktraces the interface to the proxy class. since: 0.64 |
registerInterface | public static Object registerInterface(Object object, boolean storeExceptions, boolean fullExceptions, String[] aMethodNames)(Code) | | Adding a Interface for automatic methode measurement.
Parameters: object - Interface to add Parameters: storeExceptions - if the exception stacktraces should be stored. Parameters: fullExceptions - full exceptions with stacktraces Parameters: aMethodNames - list with all methodnames that should be monitored. If thisparameter is null all methods will be monitored. since: 0.72 If you wan't to define an argument as a point name you can since: use the following syntax for the method name: <method since: name>[.arg<index of argument>] the interface to the proxy class. since: 0.64 |
removeSnapShot | public static SnapShot removeSnapShot(String snapshotname)(Code) | | removing a snapshot from the system.
Parameters: snapshotname - name of the snapshot to remove the removed snapshot or null if no snapshot withthis name is present. |
saveToXMLStream | public static void saveToXMLStream(OutputStream stream) throws IOException, SAXException(Code) | | saving all measurementpoints to an xml file structure for later
reloading.
Parameters: stream - the output stream to write the xml data to. throws: IOException - if something goes wrong in the filesystem. throws: SAXException - if something goes wrong with xml writing |
setApplicationName | public static void setApplicationName(String aApplicationName)(Code) | | Setting the application name.
Parameters: aApplicationName - The applicationName to set. |
setBackgroundProcessing | public static void setBackgroundProcessing(boolean enableBackground)(Code) | | starting and stopping background processing.
Parameters: enableBackground - true to allow background processing, otherwisefalse since: 0.68 |
setEnable | public static void setEnable(boolean aEnable)(Code) | | This methode will enable the monitor factory. If it's set to false,
start() methode will only return NullMoniotr
Objects. This value has no influenz on the start()
methode of the MeasurementsPoints. They will return normal monitor
objects even when the factory is turned of.
Parameters: aEnable - The enable to set. |
setExceptionHandling | public static void setExceptionHandling(int aExceptionHandling)(Code) | | setting the value of the exception handling.
Parameters: aExceptionHandling - one of the constants for exception handling. |
setMeasureDataCallback | public static void setMeasureDataCallback(MeasureDataCallback aMeasureDataCallback)(Code) | | setting the measureDataCallback object.
Parameters: aMeasureDataCallback - The measureDataCallback to set. |
setOption | public static void setOption(String aOptionName, String aOptionValue)(Code) | | setting some special options for this factory. Possible option names are:
- OPTION_DISABLE_DEVIATION disable calcualtion of the
deviation. Possible values are
true,false .
- OPTION_ENABLE_AUTOSNAPSHOT Enable the automatic snapshot
system. Possible values are
true,false .
- OPTION_BACKGROUND_TIME Time (in msec) to generate a new
snapshot and to prove the memory saving settings.
- OPTION_ENABLE_MEMORY_SAVINGS Enable the automatic memory
saving system. All not actually needed measure points and snapshots will
be save to the harddisk. To detemine where to sstore the data, use the
OPTIONS_WORKINGPATH. Possible values are
true,false .
- OPTION_WORKINGPATH Path where to store the measuredata for
memory savings.
- OPTION_POINT_IDLETIME Time (in sec) how long a point must be
idle before it will be saved to disk.
The memory savings and the auto snapshot feature will start a background
process, which is controlled by the
MeasureFactory.setBackgroundProcessing(boolean) method. If you
wan't to suspend the feature, set the background processing to false. But
don't forget to set it back to true, if you are ready. If you set
MeasureFactory.OPTION_BACKGROUND_TIME you have to manually enable
the background processing via
MeasureFactory.setBackgroundProcessing(boolean) . If you use the
method
MeasureFactory.setOptions(Map) the background processing
wil automatically started.
Parameters: aOptionName - the option that should be set. Parameters: aOptionValue - value of this option as String since: 0.67 |
setPriority | public static void setPriority(int aPriority)(Code) | | Setting the actual priority of the factory.
Parameters: aPriority - The priority to set. |
start | public static Monitor start(String pointName)(Code) | | Getting a new monitor for the measurement point pointName and starting
this monitor. If the point doesn't exists, it wil be created.
Parameters: pointName - name of the measurement point to use. Monitor |
takeSnapshot | public static SnapShot takeSnapshot(String snapshotname)(Code) | | new methode for making a snapshot. In a snapshot all measure points data
will be saved under the desired name. All Snapshot data will be saved
into the xml files and will be renderd, if desired. The Snapshot will
contains some individual data like the a memory snapshot.
Parameters: snapshotname - name of the snapshot. the snapshot |
|
|