modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
| 3
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
| 2
modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerOperationsDelegate.java
| 78 ++++++----
modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
| 13 +
modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
| 2
modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerOperationsDelegate.java
| 27 +++
modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
| 13 +
7 files changed, 108 insertions(+), 30 deletions(-)
New commits:
commit a3356e841e795aeaea76903e5b10bc0fef82c0fd
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Thu Mar 31 10:07:12 2011 -0400
enable refresh for config changes and hide refresh button for portlets.
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
index 013e5be..388094a 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/portlets/recent/alerts/AbstractRecentAlertsPortlet.java
@@ -66,6 +66,7 @@ public abstract class AbstractRecentAlertsPortlet extends
AlertHistoryView imple
setShowFilterForm(false); //disable filter form for portlet
setOverflow(Overflow.VISIBLE);
+ setShowFooterRefresh(false); //disable footer refresh button as redundant for
portlets
}
public Timer getRefreshTimer() {
@@ -171,6 +172,8 @@ public abstract class AbstractRecentAlertsPortlet extends
AlertHistoryView imple
// persist and reload portlet
storedPortlet.setConfiguration(portletConfig);
configure(portletWindow, storedPortlet);
+ //apply latest settings to the visible result set
+ refresh();
}
});
commit 1756884b035d86857aba75d826fd19ef4a5a153b
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Wed Mar 30 19:01:51 2011 -0400
BZ 689993: enable start/stop WAIT_MAX for AS4 and Tomcat server components.
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
index 8e967ae..f241200 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerComponent.java
@@ -133,6 +133,8 @@ public class JBossASServerComponent implements MeasurementFacet,
OperationFacet,
public static final String SCRIPT_PREFIX_CONFIG_PROP = "scriptPrefix";
public static final String CONFIGURATION_SET_CONFIG_PROP =
"configurationSet";
public static final String START_SCRIPT_CONFIG_PROP = "startScript";
+ public static final String START_WAIT_MAX_PROP = "startWaitMax";
+ public static final String STOP_WAIT_MAX_PROP = "stopWaitMax";
public static final String SHUTDOWN_SCRIPT_CONFIG_PROP = "shutdownScript";
public static final String SHUTDOWN_MBEAN_CONFIG_PROP =
"shutdownMbeanName";
public static final String SHUTDOWN_MBEAN_OPERATION_CONFIG_PROP =
"shutdownMbeanOperation";
diff --git
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerOperationsDelegate.java
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerOperationsDelegate.java
index 7bb941d..269f16c 100644
---
a/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerOperationsDelegate.java
+++
b/modules/plugins/jboss-as/src/main/java/org/rhq/plugins/jbossas/JBossASServerOperationsDelegate.java
@@ -1,25 +1,25 @@
- /*
- * Jopr Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * Jopr Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.plugins.jbossas;
import java.io.File;
@@ -34,6 +34,7 @@ import org.mc4j.ems.connection.bean.operation.EmsOperation;
import org.mc4j.ems.connection.bean.parameter.EmsParameter;
import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.core.pluginapi.util.ProcessExecutionUtility;
@@ -51,7 +52,7 @@ import org.rhq.core.system.SystemInfo;
public class JBossASServerOperationsDelegate {
/** max amount of time to wait for server to show as unavailable after executing stop
- in milliseconds */
- private static final long STOP_WAIT_MAX = 1000L * 150; // 2.5 minutes
+ private static long STOP_WAIT_MAX = 1000L * 150; // 2.5 minutes
/** amount of time to wait between availability checks when performing a stop - in
milliseconds */
private static final long STOP_WAIT_INTERVAL = 1000L * 10; // 10 seconds
@@ -61,7 +62,7 @@ public class JBossASServerOperationsDelegate {
private static final long STOP_WAIT_FINAL = 1000L * 30; // 30 seconds
/** max amount of time to wait for start to complete - in milliseconds */
- private static final long START_WAIT_MAX = 1000L * 300; // 5 minutes
+ private static long START_WAIT_MAX = 1000L * 300; // 5 minutes
/** amount of time to wait between availability checks when performing a start - in
milliseconds */
private static final long START_WAIT_INTERVAL = 1000L * 10; // 10 seconds
@@ -369,24 +370,34 @@ public class JBossASServerOperationsDelegate {
try {
shutdown();
} catch (Exception e) {
- throw new RuntimeException("Shutdown may have failed: " +e );
+ throw new RuntimeException("Shutdown may have failed: " + e);
}
-
try {
// Perform the restart.
start();
} catch (Exception e) {
- throw new RuntimeException("Re-Startup may have failed: " +e );
+ throw new RuntimeException("Re-Startup may have failed: " + e);
}
- return"Server has been restarted.";
+ return "Server has been restarted.";
}
private AvailabilityType waitForServerToStart(long start) throws InterruptedException
{
AvailabilityType avail;
+ //detect whether startWaitMax property has been set.
+ Configuration pluginConfig = serverComponent.getPluginConfiguration();
+ PropertySimple property =
pluginConfig.getSimple(JBossASServerComponent.START_WAIT_MAX_PROP);
+ //if set and valid, update startWaitMax value
+ if ((property != null) && (property.getIntegerValue() != null)) {
+ int newValue = property.getIntegerValue();
+ if (newValue >= 1) {
+ START_WAIT_MAX = 1000L * 60 * newValue;
+ }
+ }
+
while (((avail = this.serverComponent.getAvailability()) ==
AvailabilityType.DOWN)
&& (System.currentTimeMillis() < (start + START_WAIT_MAX))) {
try {
@@ -399,6 +410,17 @@ public class JBossASServerOperationsDelegate {
}
private AvailabilityType waitForServerToShutdown() {
+ //detect whether stopWaitMax property has been set.
+ Configuration pluginConfig = serverComponent.getPluginConfiguration();
+ PropertySimple property =
pluginConfig.getSimple(JBossASServerComponent.STOP_WAIT_MAX_PROP);
+ //if set and valid, update startWaitMax value
+ if ((property != null) && (property.getIntegerValue() != null)) {
+ int newValue = property.getIntegerValue();
+ if (newValue >= 1) {
+ STOP_WAIT_MAX = 1000L * 60 * newValue;
+ }
+ }
+
for (long wait = 0L; (wait < STOP_WAIT_MAX) && (AvailabilityType.UP ==
this.serverComponent.getAvailability()); wait += STOP_WAIT_INTERVAL) {
try {
Thread.sleep(STOP_WAIT_INTERVAL);
diff --git a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
index 28240ef..192c7f1 100644
--- a/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as/src/main/resources/META-INF/rhq-plugin.xml
@@ -74,6 +74,19 @@
description="The absolute path to a JRE or JDK
installation directory containing
the JVM that should be used to start and
shutdown the JBossAS instance;
defaults to the home directory of the RHQ
agent JRE."/>
+
+ <c:simple-property name="startWaitMax"
required="false"
+ description="The time, in minutes,(e.g. 1 or 8) that
must elapse before the server is considered to have failed to start up. The default is 5
minutes.">
+ <c:constraint>
+ <c:integer-constraint minimum="1"/>
+ </c:constraint>
+ </c:simple-property>
+ <c:simple-property name="stopWaitMax"
required="false"
+ description="The time, in minutes,(e.g. 1 or 8) that
must elapse before the server is considered to have failed to stop. The default is 2.5
minutes.">
+ <c:constraint>
+ <c:integer-constraint minimum="1"/>
+ </c:constraint>
+ </c:simple-property>
</c:group>
<c:group name="event" displayName="Events">
diff --git
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
index 89cbd72..d67f072 100644
---
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
+++
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerComponent.java
@@ -104,6 +104,8 @@ public class TomcatServerComponent implements JMXComponent,
MeasurementFacet, Op
public static final String PLUGIN_CONFIG_SCRIPT_PREFIX = "scriptPrefix";
public static final String PLUGIN_CONFIG_SHUTDOWN_SCRIPT =
"shutdownScript";
public static final String PLUGIN_CONFIG_START_SCRIPT = "startScript";
+ public static final String START_WAIT_MAX_PROP = "startWaitMax";
+ public static final String STOP_WAIT_MAX_PROP = "stopWaitMax";
private Log log = LogFactory.getLog(this.getClass());
diff --git
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerOperationsDelegate.java
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerOperationsDelegate.java
index b0f3f7c..ce542a9 100644
---
a/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerOperationsDelegate.java
+++
b/modules/plugins/tomcat/src/main/java/org/jboss/on/plugins/tomcat/TomcatServerOperationsDelegate.java
@@ -41,6 +41,7 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.configuration.Property;
import org.rhq.core.domain.configuration.PropertyList;
import org.rhq.core.domain.configuration.PropertyMap;
+import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.pluginapi.operation.OperationResult;
import org.rhq.core.pluginapi.util.ProcessExecutionUtility;
@@ -64,7 +65,7 @@ public class TomcatServerOperationsDelegate {
private static final String SERVER_MBEAN_NAME = "Catalina:type=Server";
/** max amount of time to wait for server to show as unavailable after executing stop
- in milliseconds */
- private static final long STOP_WAIT_MAX = 1000L * 150; // 2.5 minutes
+ private static long STOP_WAIT_MAX = 1000L * 150; // 2.5 minutes
/** amount of time to wait between availability checks when performing a stop - in
milliseconds */
private static final long STOP_WAIT_INTERVAL = 1000L * 10; // 10 seconds
@@ -74,7 +75,7 @@ public class TomcatServerOperationsDelegate {
private static final long STOP_WAIT_FINAL = 1000L * 30; // 30 seconds
/** max amount of time to wait for start to complete - in milliseconds */
- private static final long START_WAIT_MAX = 1000L * 300; // 5 minutes
+ private static long START_WAIT_MAX = 1000L * 300; // 5 minutes
/** amount of time to wait between availability checks when performing a start - in
milliseconds */
private static final long START_WAIT_INTERVAL = 1000L * 10; // 10 seconds
@@ -466,6 +467,18 @@ public class TomcatServerOperationsDelegate {
private AvailabilityType waitForServerToStart(long start) throws InterruptedException
{
AvailabilityType avail;
+
+ //detect whether startWaitMax property has been set.
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
+ PropertySimple property =
pluginConfig.getSimple(TomcatServerComponent.START_WAIT_MAX_PROP);
+ //if set and valid, update startWaitMax value
+ if ((property != null) && (property.getIntegerValue() != null)) {
+ int newValue = property.getIntegerValue();
+ if (newValue >= 1) {
+ START_WAIT_MAX = 1000L * 60 * newValue;
+ }
+ }
+
while (((avail = this.serverComponent.getAvailability()) ==
AvailabilityType.DOWN)
&& (System.currentTimeMillis() < (start + START_WAIT_MAX))) {
try {
@@ -478,6 +491,16 @@ public class TomcatServerOperationsDelegate {
}
private AvailabilityType waitForServerToShutdown() {
+ //detect whether stopWaitMax property has been set.
+ Configuration pluginConfig =
serverComponent.getResourceContext().getPluginConfiguration();
+ PropertySimple property =
pluginConfig.getSimple(TomcatServerComponent.STOP_WAIT_MAX_PROP);
+ //if set and valid, update startWaitMax value
+ if ((property != null) && (property.getIntegerValue() != null)) {
+ int newValue = property.getIntegerValue();
+ if (newValue >= 1) {
+ STOP_WAIT_MAX = 1000L * 60 * newValue;
+ }
+ }
for (long wait = 0L; (wait < STOP_WAIT_MAX) && (AvailabilityType.UP ==
this.serverComponent.getAvailability()); wait += STOP_WAIT_INTERVAL) {
try {
Thread.sleep(STOP_WAIT_INTERVAL);
diff --git a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
index 5d511cc..24307ef 100644
--- a/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/tomcat/src/main/resources/META-INF/rhq-plugin.xml
@@ -96,6 +96,19 @@
description="The path to the script used by the 'Shutdown'
operation to shutdown this Tomcat server;
if the path is not absolute it will be
resolved relative to {installationPath}." />
+ <c:simple-property name="startWaitMax"
required="false"
+ description="The time, in minutes,(e.g. 1 or 8) that
must elapse before the server is considered to have failed to start up. The default is 5
minutes.">
+ <c:constraint>
+ <c:integer-constraint minimum="1"/>
+ </c:constraint>
+ </c:simple-property>
+ <c:simple-property name="stopWaitMax"
required="false"
+ description="The time, in minutes,(e.g. 1 or 8) that
must elapse before the server is considered to have failed to stop. The default is 2.5
minutes.">
+ <c:constraint>
+ <c:integer-constraint minimum="1"/>
+ </c:constraint>
+ </c:simple-property>
+
<c:list-property
name="startScriptEnvironment"
displayName="Start Script Environment Variables"