Commit 1f480425 authored by afreyssin's avatar afreyssin

Changes the configuration properties.

parent eb400c76
......@@ -44,7 +44,7 @@ public class FileMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.FileMonitoringTimerTask
*/
public final static String MONITORING_CONFIG_PERIOD_PROPERTY = "FILE_MONITORING_CONFIG_PERIOD";
public final static String MONITORING_CONFIG_PERIOD_PROPERTY = "org.ow2.joram.monitoring.FILE_CONFIG_PERIOD";
/**
* Default value for the scanning period for the csv file monitoring task in the
* server, value is <code>60000L</code> (60 seconds).
......@@ -62,7 +62,7 @@ public class FileMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.FileMonitoringTimerTask
*/
public final static String MONITORING_CONFIG_PATH_PROPERTY = "FILE_MONITORING_CONFIG_PATH";
public final static String MONITORING_CONFIG_PATH_PROPERTY = "org.ow2.joram.monitoring.FILE_CONFIG_PATH";
/**
* Default value for the pathname of a configuration file for a csv file monitoring
* task in the server, value is <code>fileMonitoring.props</code>.
......@@ -82,7 +82,7 @@ public class FileMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.FileMonitoringTimerTask
*/
public final static String MONITORING_RESULT_PATH_PROPERTY = "FILE_MONITORING_RESULT_PATH";
public final static String MONITORING_RESULT_PATH_PROPERTY = "org.ow2.joram.monitoring.FILE_RESULT_PATH";
/**
* Default value for the pathname of the results file for the monitoring task
* in the server, value is <code>monitoringStats.csv</code>.
......@@ -136,7 +136,7 @@ public class FileMonitoringTimerTask extends MonitoringTimerTask {
super.period = period;
super.attlist = (Properties) attlist.clone();
path = taskProps.getProperty("resultPath");
path = taskProps.getProperty("result.path");
try {
writer = new FileWriter(path, true);
......
......@@ -44,7 +44,7 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
*/
public final static String MONITORING_CONFIG_PERIOD_PROPERTY = "LOG_MONITORING_CONFIG_PERIOD";
public final static String MONITORING_CONFIG_PERIOD_PROPERTY = "org.ow2.joram.monitoring.LOG_CONFIG_PERIOD";
/**
* Default value for the scanning period for the log monitoring task in the
* server, value is <code>60000L</code> (60 seconds).
......@@ -62,7 +62,7 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
*/
public final static String MONITORING_CONFIG_PATH_PROPERTY = "LOG_MONITORING_CONFIG_PATH";
public final static String MONITORING_CONFIG_PATH_PROPERTY = "org.ow2.joram.monitoring.LOG_CONFIG_PATH";
/**
* Default value for the pathname of a configuration file for a log monitoring
* task in the server, value is <code>logMonitoring.props</code>.
......@@ -82,7 +82,7 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
*/
public final static String MONITORING_RESULT_LOGGER_PROPERTY = "LOG_MONITORING_RESULT_LOGGER";
public final static String MONITORING_RESULT_LOGGER_PROPERTY = "org.ow2.joram.monitoring.LOG_RESULT_LOGGER";
/**
* Default value for the logger name of the results for the log monitoring task
* in the server, value is <code>fr.dyade.aaa.agent.Monitoring</code>.
......@@ -100,7 +100,7 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
*/
public final static String MONITORING_RESULT_LEVEL_PROPERTY = "LOG_MONITORING_RESULT_LEVEL";
public final static String MONITORING_RESULT_LEVEL_PROPERTY = "org.ow2.joram.monitoring.LOG_RESULT_LEVEL";
/**
* Default value for the logging level of the results for the log monitoring task
* in the server, value is <code>WARN</code>.
......@@ -118,7 +118,7 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
*
* @see fr.dyade.aaa.common.monitoring.LogMonitoringTimerTask
*/
public final static String MONITORING_RESULT_MESSAGE_PROPERTY = "LOG_MONITORING_RESULT_MESSAGE";
public final static String MONITORING_RESULT_MESSAGE_PROPERTY = "org.ow2.joram.monitoring.LOG_RESULT_MESSAGE";
/**
* Default value for the logging message of the results for the log monitoring task
* in the server, value is <code>"JMX Monitoring "</code>.
......@@ -172,9 +172,9 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
super.period = period;
super.attlist = (Properties)attlist.clone();
this.monitoringLogger = Debug.getLogger(taskProps.getProperty("logname"));
this.msg = taskProps.getProperty("msg");
this.level = getLevel(taskProps.getProperty("level"));
this.monitoringLogger = Debug.getLogger(taskProps.getProperty("result.logger"));
this.msg = taskProps.getProperty("log.message");
this.level = getLevel(taskProps.getProperty("log.level"));
strbuf = new StringBuffer();
......@@ -227,7 +227,8 @@ public class LogMonitoringTimerTask extends MonitoringTimerTask {
int level = DEFAULT_MONITORING_RESULT_LEVEL;
try {
level = Integer.parseInt(levelName);
if (levelName != null)
level = Integer.parseInt(levelName);
} catch (Exception e) {
if (levelName.equals("BasicLevel.DEBUG"))
level = BasicLevel.DEBUG;
......
......@@ -32,6 +32,7 @@ import java.util.Properties;
import java.util.Random;
import java.util.Timer;
import java.lang.Math;
import javax.swing.*;
/**
......@@ -39,11 +40,55 @@ import javax.swing.*;
* JMX attributes and send the corresponding values to the outpuStrean.
*/
public class WindowMonitoringTimerTask extends MonitoringTimerTask {
/**
* Name of property allowing to fix the scanning period for the monitoring
* task in the server.
* <p>
* This property can be fixed either from <code>java</code> launching command,
* or in <code>a3servers.xml</code> configuration file.
*/
public final static String MONITORING_CONFIG_PERIOD_PROPERTY = "WINDOW_MONITORING_CONFIG_PERIOD";
/**
* Default value for the scanning period for the monitoring task in the
* server, value is <code>60000L</code> (60 seconds).
*/
public final static long DEFAULT_MONITORING_CONFIG_PERIOD = 15000L;
/**
* Name of property allowing to fix the pathname of a configuration file for the
* monitoring task in the server.
* <p>
* This property can be fixed either from <code>java</code> launching command,
* or in <code>a3servers.xml</code> configuration file.
*/
public final static String MONITORING_CONFIG_PATH_PROPERTY = "FILE_MONITORING_CONFIG_PATH";
/**
* Default value for the pathname of a configuration file for the monitoring task
* in the server, value is <code>windowMonitoring.props</code>.
* <p>
* If the file does not exist the timer task is not launched.
*/
public final static String DEFAULT_MONITORING_CONFIG_PATH = "windowMonitoring.props";
StringBuffer strbuf = null;
StringBuffer strbuf = new StringBuffer();
JTextArea textArea;
JTextField attField, addMbeanField, delMbeanField;
Graphics graph;
/**
* Initializes the <code>FileMonitoringTimerTask</code> component.
*
* @param timer Timer to use to schedule the resulting task.
* @param period Period value of the resulting task
* @param attlist List of JMX attributes to periodically watch.
*/
public WindowMonitoringTimerTask(Timer timer, long period, Properties attlist) {
super(period, attlist);
GUI("Monitoring", 100, 100);
start(timer);
}
/**
* Instantiates the <code>WindowMonitoringTimerTask</code> component.
......@@ -58,8 +103,6 @@ public class WindowMonitoringTimerTask extends MonitoringTimerTask {
public void init(Timer timer, long period, Properties attlist, Properties taskProps){
super.period = period;
super.attlist = (Properties)attlist.clone();
strbuf = new StringBuffer();
GUI(taskProps.getProperty("name"), 100, 100);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment