}
else
{
try
{
StringThresholdMonitor monitor = new StringThresholdMonitor();
monitor.setMonitorName(monitorName);
monitor.setObservedObject(oname);
monitor.setObservedAttribute(attribute);
monitor.setThreshold(threshold);
monitor.setEnabled(new Boolean(enabled).booleanValue());
monitor.setPeriod(timePeriod);
monitor.setEqualityTriggersAlert(equality);
ArrayList list = new ArrayList();
for (int i = 0; i < alerts.length; i++)
{
list.add(new ObjectName(alerts[i]));
}
monitor.setAlertListeners(list);
mbeanServer.registerMBean(monitor, new ObjectName("jboss.monitor:name=" + monitorName));
monitor.create();
monitor.start();
}
catch (Exception ex)
{
error("Failed to create non-persisted monitor: " + ex.toString(), req, resp);
}