[rhq] Branch 'release/jon3.2.x' - modules/enterprise
by Jiri Kremser
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java | 9 +++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 14 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java | 4 ++
3 files changed, 24 insertions(+), 3 deletions(-)
New commits:
commit ade3c186a801dc897f0d2e9fd648d1d9c245b0dd
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Nov 27 17:02:56 2013 +0100
[BZ 1035280] - Cannot load metrics for platform resource created using rest api - adding a check whether the agent is the dummy one for MeasurementDataManagerBean.findLiveData() and ResourceManagerBean.getLiveAvailability().
(cherry picked from commit 94e2c04316352993550b4837bd27aadacfffdbb2)
Conflicts:
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
index ee679f1..d1aa970 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
@@ -92,11 +92,12 @@ import org.rhq.enterprise.server.alert.engine.AlertConditionCacheStats;
import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.authz.PermissionException;
-import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.core.AgentManagerLocal;
import org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor;
import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.rest.ResourceHandlerBean;
+import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
import org.rhq.server.metrics.MetricsServer;
@@ -869,6 +870,12 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
Query query = entityManager.createNamedQuery(Agent.QUERY_FIND_BY_RESOURCE_ID);
query.setParameter("resourceId", resourceId);
Agent agent = (Agent) query.getSingleResult();
+
+ // return empty data if the agent is the dummy one
+ if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
+ && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
+ return Collections.<MeasurementData> emptySet();
+ }
query = entityManager.createNamedQuery(MeasurementSchedule.FIND_BY_RESOURCE_IDS_AND_DEFINITION_IDS);
query.setParameter("definitionIds", ArrayUtils.wrapInList(definitionIds));
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
index a58bd3c..8a78995 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
@@ -81,6 +81,7 @@ import org.rhq.core.domain.event.EventSource;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementBaseline;
+import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementOOB;
import org.rhq.core.domain.measurement.MeasurementSchedule;
@@ -2451,7 +2452,18 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
try {
// first, quickly see if we can even ping the agent, if not, don't bother trying to get the resource avail
- AgentClient client = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
+ Agent agent = agentManager.getAgentByResourceId(subject, resourceId);
+ if (agent == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Resource [" + resourceId + "] does not exist or has no agent assigned");
+ }
+ new IllegalStateException("No agent is associated with the resource with id [" + resourceId + "]");
+ } else if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
+ && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
+ // dummy agent created from REST
+ return getResourceById(subject, resourceId).getCurrentAvailability();
+ }
+ AgentClient client = agentManager.getAgentClient(agent);
if (client == null) {
throw new IllegalStateException("No agent is associated with the resource with id [" + resourceId + "]");
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 3480f3b..9cdcddd 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -127,6 +127,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
// Name prefix for synthetic/dummy agents created with the rest api. See #createPlatformInternal
public static final String DUMMY_AGENT_NAME_PREFIX = "dummy-agent:name";
+ public static final String DUMMY_AGENT_TOKEN_PREFIX = "abc-";
@EJB
AvailabilityManagerLocal availMgr;
@@ -670,7 +671,8 @@ public class ResourceHandlerBean extends AbstractRestBean {
// Create a dummy agent per platform - otherwise we can't delete the platform later
// See also https://docs.jboss.org/author/display/RHQ/Virtual+platforms+and+synthetic...
Agent agent ;
- agent = new Agent(DUMMY_AGENT_NAME_PREFIX +name,"-dummy-p:"+name,12345,"http://foo.com/p:name/"+name,"abc-"+name);
+ agent = new Agent(DUMMY_AGENT_NAME_PREFIX + name, "-dummy-p:" + name, 12345, "http://foo.com/p:name/" + name,
+ DUMMY_AGENT_TOKEN_PREFIX + name);
agentMgr.createAgent(agent);
Resource platform = new Resource(resourceKey,name,type);
10 years, 5 months
[rhq] modules/enterprise
by Jiri Kremser
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java | 7 +++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 14 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java | 4 ++
3 files changed, 23 insertions(+), 2 deletions(-)
New commits:
commit 94e2c04316352993550b4837bd27aadacfffdbb2
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Wed Nov 27 17:02:56 2013 +0100
[BZ 1035280] - Cannot load metrics for platform resource created using rest api - adding a check whether the agent is the dummy one for MeasurementDataManagerBean.findLiveData() and ResourceManagerBean.getLiveAvailability().
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
index 4a5fc73..9612405 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java
@@ -100,6 +100,7 @@ import org.rhq.enterprise.server.core.AgentManagerLocal;
import org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor;
import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility;
import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal;
+import org.rhq.enterprise.server.rest.ResourceHandlerBean;
import org.rhq.enterprise.server.storage.StorageClientManagerBean;
import org.rhq.enterprise.server.util.CriteriaQueryGenerator;
import org.rhq.enterprise.server.util.CriteriaQueryRunner;
@@ -884,6 +885,12 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal,
Query query = entityManager.createNamedQuery(Agent.QUERY_FIND_BY_RESOURCE_ID);
query.setParameter("resourceId", resourceId);
Agent agent = (Agent) query.getSingleResult();
+
+ // return empty data if the agent is the dummy one
+ if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
+ && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
+ return Collections.<MeasurementData> emptySet();
+ }
query = entityManager.createNamedQuery(MeasurementSchedule.FIND_BY_RESOURCE_IDS_AND_DEFINITION_IDS);
query.setParameter("definitionIds", ArrayUtils.wrapInList(definitionIds));
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
index a58bd3c..8a78995 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
@@ -81,6 +81,7 @@ import org.rhq.core.domain.event.EventSource;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.measurement.AvailabilityType;
import org.rhq.core.domain.measurement.MeasurementBaseline;
+import org.rhq.core.domain.measurement.MeasurementData;
import org.rhq.core.domain.measurement.MeasurementDataTrait;
import org.rhq.core.domain.measurement.MeasurementOOB;
import org.rhq.core.domain.measurement.MeasurementSchedule;
@@ -2451,7 +2452,18 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
try {
// first, quickly see if we can even ping the agent, if not, don't bother trying to get the resource avail
- AgentClient client = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
+ Agent agent = agentManager.getAgentByResourceId(subject, resourceId);
+ if (agent == null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Resource [" + resourceId + "] does not exist or has no agent assigned");
+ }
+ new IllegalStateException("No agent is associated with the resource with id [" + resourceId + "]");
+ } else if (agent.getName().startsWith(ResourceHandlerBean.DUMMY_AGENT_NAME_PREFIX)
+ && agent.getAgentToken().startsWith(ResourceHandlerBean.DUMMY_AGENT_TOKEN_PREFIX)) {
+ // dummy agent created from REST
+ return getResourceById(subject, resourceId).getCurrentAvailability();
+ }
+ AgentClient client = agentManager.getAgentClient(agent);
if (client == null) {
throw new IllegalStateException("No agent is associated with the resource with id [" + resourceId + "]");
}
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index 3480f3b..9cdcddd 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -127,6 +127,7 @@ public class ResourceHandlerBean extends AbstractRestBean {
// Name prefix for synthetic/dummy agents created with the rest api. See #createPlatformInternal
public static final String DUMMY_AGENT_NAME_PREFIX = "dummy-agent:name";
+ public static final String DUMMY_AGENT_TOKEN_PREFIX = "abc-";
@EJB
AvailabilityManagerLocal availMgr;
@@ -670,7 +671,8 @@ public class ResourceHandlerBean extends AbstractRestBean {
// Create a dummy agent per platform - otherwise we can't delete the platform later
// See also https://docs.jboss.org/author/display/RHQ/Virtual+platforms+and+synthetic...
Agent agent ;
- agent = new Agent(DUMMY_AGENT_NAME_PREFIX +name,"-dummy-p:"+name,12345,"http://foo.com/p:name/"+name,"abc-"+name);
+ agent = new Agent(DUMMY_AGENT_NAME_PREFIX + name, "-dummy-p:" + name, 12345, "http://foo.com/p:name/" + name,
+ DUMMY_AGENT_TOKEN_PREFIX + name);
agentMgr.createAgent(agent);
Resource platform = new Resource(resourceKey,name,type);
10 years, 5 months
[rhq] Branch 'jay-avail' - modules/core
by mazz
modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java | 28 +++-------
1 file changed, 10 insertions(+), 18 deletions(-)
New commits:
commit ebba986c1b5beb93b16d6a96d0fa9048275d748c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 27 10:28:09 2013 -0500
fix up the test - this is still failing, but took out some unnecessary things
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java
index ed2764a..f2880dd 100644
--- a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java
@@ -35,28 +35,20 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet;
@Test(enabled = false)
public class AvailabilityProxyConcurrencyTest implements AvailabilityFacet {
- private volatile int availSleepMillis;
- private ExecutorService executor;
- private volatile boolean interrupted;
-
public void testConcurrentAvailChecks() throws Exception {
Thread.interrupted(); // clear any hanging around interrupt status
- executor = Executors.newCachedThreadPool();
+ ExecutorService executor = Executors.newCachedThreadPool();
try {
// our one proxy we want to call concurrently
final AvailabilityProxy ap = new AvailabilityProxy(this, executor, getClass().getClassLoader());
// prime the pump by getting the first one without problems
- availSleepMillis = 1;
- interrupted = false;
AvailabilityType firstAvail = ap.getAvailability();
assert UP.equals(firstAvail) : "Can't even get our first avail correctly: " + firstAvail;
- assert !interrupted;
// create several threads that will concurrently call getAvailability
- availSleepMillis = 500;
- final int numThreads = 3;
+ final int numThreads = 2;
final Hashtable<String, AvailabilityType> availResults = new Hashtable<String, AvailabilityType>(numThreads);
final Hashtable<String, Date> dateResults = new Hashtable<String, Date>(numThreads);
final Hashtable<String, Throwable> throwableResults = new Hashtable<String, Throwable>(numThreads);
@@ -82,13 +74,12 @@ public class AvailabilityProxyConcurrencyTest implements AvailabilityFacet {
}
// release the hounds! then wait for them to all finish
- System.out.println("THREADS STARTED AT: " + new Date());
+ System.out.println("~~~THREADS STARTED AT: " + new Date());
startLatch.countDown();
- endLatch.await(10, TimeUnit.SECONDS); // should never take this long
- System.out.println("THREADS FINISHED AT: " + new Date());
- System.out.println("THREAD FINISH TIMES: " + dateResults);
- System.out.println("THREADS WITH EXCEPTIONS: " + throwableResults);
- assert !interrupted : "Why was this interrupted?";
+ endLatch.await(10000, TimeUnit.SECONDS); // should never take this long
+ System.out.println("~~~THREADS FINISHED AT: " + new Date());
+ System.out.println("~~~THREAD FINISH TIMES: " + dateResults);
+ System.out.println("~~~THREADS WITH EXCEPTIONS: " + throwableResults);
// now make sure all of them returns UP
assert availResults.size() == numThreads : "Failed, bad threads: availResults = " + availResults;
@@ -103,8 +94,9 @@ public class AvailabilityProxyConcurrencyTest implements AvailabilityFacet {
@Override
public synchronized AvailabilityType getAvailability() {
try {
- Thread.sleep(availSleepMillis);
- } catch (InterruptedException e) {
+ Thread.sleep(750);
+ } catch (Exception e) {
+ System.out.println("~~~AVAILABILITY SLEEP WAS ABORTED: " + e);
}
return UP;
}
10 years, 5 months
[rhq] Branch 'jay-avail' - modules/core
by mazz
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java | 21 ++++++----
1 file changed, 13 insertions(+), 8 deletions(-)
New commits:
commit bd327772cdf65afeed256c154fe4b10c7f6e62cb
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Wed Nov 27 10:27:02 2013 -0500
To reduce the memory footprint of the proxy, make logger static.
We don't want one logger instance per proxy.
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
index 40edfa7..4e14581 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
@@ -40,11 +40,16 @@ import org.rhq.core.pluginapi.availability.AvailabilityFacet;
* second, the next call to {@link #getAvailability()} will return the
* calculated availability, if available.
*
+ * With the potential of having thousands, and even tens of thousands, of instances
+ * of this proxy, we must ensure that we keep it as lean as possible to reduce
+ * memory footprint of the agent. For example, we do not create a logger object for
+ * every proxy. Instead, LOG is static. This should be OK for how this proxy is used.
+ *
* @author Elias Ross
*/
public class AvailabilityProxy implements AvailabilityFacet, Callable<AvailabilityType> {
- private final Log log = LogFactory.getLog(AvailabilityProxy.class);
+ private static final Log LOG = LogFactory.getLog(AvailabilityProxy.class); // purposefully static, don't create one per proxy
/**
* How long to wait for a resource to return their availability immediately (in ms).
@@ -177,13 +182,13 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
} else if (availAsyncConsecutiveTimeouts == AVAIL_SYNC_TIMEOUT_LIMIT) {
// log one time that we are disabling synchronous checks for this resource
++availAsyncConsecutiveTimeouts;
- if (log.isDebugEnabled()) {
- log.debug("Disabling synchronous availability collection for [" + resourceComponent + "]; ["
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Disabling synchronous availability collection for [" + resourceComponent + "]; ["
+ AVAIL_SYNC_TIMEOUT_LIMIT + "] consective timeouts exceeding [" + AVAIL_SYNC_TIMEOUT + "ms]");
}
}
} catch (InterruptedException e) {
- log.debug("InterruptedException; shut down is (likely) in progress.");
+ LOG.debug("InterruptedException; shut down is (likely) in progress.");
availabilityFuture.cancel(true);
availabilityFuture = null;
Thread.currentThread().interrupt();
@@ -207,8 +212,8 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
case DOWN:
break;
default:
- if (log.isDebugEnabled()) {
- log.debug("ResourceComponent " + resourceComponent + " getAvailability() returned " + type
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("ResourceComponent " + resourceComponent + " getAvailability() returned " + type
+ ". This is invalid and is being replaced with DOWN.");
}
result = DOWN;
@@ -220,8 +225,8 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
if (result != last) {
if (result == UP) {
if (availAsyncConsecutiveTimeouts >= AVAIL_SYNC_TIMEOUT_LIMIT) {
- if (log.isDebugEnabled()) {
- log.debug("Enabling synchronous availability collection for [" + resourceComponent
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Enabling synchronous availability collection for [" + resourceComponent
+ "]; Availability has just changed from [" + last + "] to UP.");
}
}
10 years, 5 months
[rhq] Branch 'jay-avail' - modules/core
by mazz
modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java | 111 ++++++++++
1 file changed, 111 insertions(+)
New commits:
commit b2539ee14e487ed58dbf1f041f13420db14965f7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Nov 26 18:05:38 2013 -0500
unit test that illustrates failure that is talked about in BZ 971556, comments #8 and 9.
this test is disabled for now, since it will fail.
diff --git a/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java
new file mode 100644
index 0000000..ed2764a
--- /dev/null
+++ b/modules/core/plugin-container/src/test/java/org/rhq/core/pc/inventory/AvailabilityProxyConcurrencyTest.java
@@ -0,0 +1,111 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2013 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 as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * 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 for more details.
+ *
+ * You should have received a copy of the GNU 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.core.pc.inventory;
+
+import static org.rhq.core.domain.measurement.AvailabilityType.UP;
+
+import java.util.Date;
+import java.util.Hashtable;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.testng.annotations.Test;
+
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.availability.AvailabilityFacet;
+
+@Test(enabled = false)
+public class AvailabilityProxyConcurrencyTest implements AvailabilityFacet {
+
+ private volatile int availSleepMillis;
+ private ExecutorService executor;
+ private volatile boolean interrupted;
+
+ public void testConcurrentAvailChecks() throws Exception {
+ Thread.interrupted(); // clear any hanging around interrupt status
+
+ executor = Executors.newCachedThreadPool();
+ try {
+ // our one proxy we want to call concurrently
+ final AvailabilityProxy ap = new AvailabilityProxy(this, executor, getClass().getClassLoader());
+
+ // prime the pump by getting the first one without problems
+ availSleepMillis = 1;
+ interrupted = false;
+ AvailabilityType firstAvail = ap.getAvailability();
+ assert UP.equals(firstAvail) : "Can't even get our first avail correctly: " + firstAvail;
+ assert !interrupted;
+
+ // create several threads that will concurrently call getAvailability
+ availSleepMillis = 500;
+ final int numThreads = 3;
+ final Hashtable<String, AvailabilityType> availResults = new Hashtable<String, AvailabilityType>(numThreads);
+ final Hashtable<String, Date> dateResults = new Hashtable<String, Date>(numThreads);
+ final Hashtable<String, Throwable> throwableResults = new Hashtable<String, Throwable>(numThreads);
+ final CountDownLatch startLatch = new CountDownLatch(1);
+ final CountDownLatch endLatch = new CountDownLatch(numThreads);
+ final Runnable runnable = new Runnable() {
+ public void run() {
+ try {
+ startLatch.await();
+ AvailabilityType availCheck = ap.getAvailability();
+ availResults.put(Thread.currentThread().getName(), availCheck);
+ } catch (Exception e) {
+ throwableResults.put(Thread.currentThread().getName(), e);
+ } finally {
+ dateResults.put(Thread.currentThread().getName(), new Date());
+ endLatch.countDown();
+ }
+ }
+ };
+ for (int i = 0; i < numThreads; i++) {
+ Thread t = new Thread(runnable, "t" + i);
+ t.start();
+ }
+
+ // release the hounds! then wait for them to all finish
+ System.out.println("THREADS STARTED AT: " + new Date());
+ startLatch.countDown();
+ endLatch.await(10, TimeUnit.SECONDS); // should never take this long
+ System.out.println("THREADS FINISHED AT: " + new Date());
+ System.out.println("THREAD FINISH TIMES: " + dateResults);
+ System.out.println("THREADS WITH EXCEPTIONS: " + throwableResults);
+ assert !interrupted : "Why was this interrupted?";
+
+ // now make sure all of them returns UP
+ assert availResults.size() == numThreads : "Failed, bad threads: availResults = " + availResults;
+ for (AvailabilityType availtype : availResults.values()) {
+ assert availtype.equals(UP) : "Failed, bad avail: availResults = " + availResults;
+ }
+ } finally {
+ executor.shutdownNow();
+ }
+ }
+
+ @Override
+ public synchronized AvailabilityType getAvailability() {
+ try {
+ Thread.sleep(availSleepMillis);
+ } catch (InterruptedException e) {
+ }
+ return UP;
+ }
+}
\ No newline at end of file
10 years, 5 months
[rhq] modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 48 +++++++++-
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 3
2 files changed, 47 insertions(+), 4 deletions(-)
New commits:
commit 6b6f1894258cb4dcbcd2cdcf82908a1d266f3f59
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Nov 26 14:46:14 2013 -0800
[BZ 1034852] time range change in summary->activity doesn't change time range in monitoring->metrics
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index b3b734a..c1d7269 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -33,6 +33,9 @@ import com.smartgwt.client.types.Overflow;
import com.smartgwt.client.types.VerticalAlignment;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.HTMLFlow;
+import com.smartgwt.client.widgets.Window;
+import com.smartgwt.client.widgets.events.CloseClickEvent;
+import com.smartgwt.client.widgets.events.CloseClickHandler;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.events.SubmitValuesEvent;
import com.smartgwt.client.widgets.form.events.SubmitValuesHandler;
@@ -67,7 +70,6 @@ import org.rhq.coregui.client.dashboard.portlets.PortletConfigurationEditorCompo
import org.rhq.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.coregui.client.gwt.GWTServiceLookup;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.coregui.client.inventory.common.graph.CustomDateRangeState;
import org.rhq.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView;
import org.rhq.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3MultiLineGraph;
@@ -83,6 +85,7 @@ import org.rhq.coregui.client.util.enhanced.EnhancedVLayout;
*/
public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettingsPortlet, AutoRefreshPortlet {
+ public static final String CHART_TITLE = MSG.common_title_metric_chart();
private int groupId = -1;
private EntityContext context;
protected Canvas recentMeasurementsContent = new Canvas();
@@ -99,6 +102,10 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
protected Timer refreshTimer;
+ // final version needed to pass to anon classes
+ // so we can call refresh in anon callback handler
+ final protected GroupMetricsPortlet refreshablePortlet;
+
//defines the list of configuration elements to load/persist for this portlet
protected static List<String> CONFIG_INCLUDE = new ArrayList<String>();
static {
@@ -113,6 +120,7 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
super();
this.groupId = context.getGroupId();
this.context = context;
+ this.refreshablePortlet = this;
}
@Override
@@ -372,7 +380,7 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
@Override
public void onClick(ClickEvent event) {
ChartViewWindow window = new ChartViewWindow(
- title);
+ title, "", refreshablePortlet);
CompositeGroupD3GraphListView graph = new CompositeGroupD3MultiLineGraph(
groupId, md.getId(), isAutoGroup);
window.addItem(graph);
@@ -489,4 +497,40 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
protected void setRefreshing(boolean currentlyRefreshing) {
this.currentlyLoading = currentlyRefreshing;
}
+ public static class ChartViewWindow extends Window {
+
+
+ public ChartViewWindow(String title, String windowTitle,final GroupMetricsPortlet portlet) {
+ super();
+ if ((windowTitle != null) && (!windowTitle.trim().isEmpty())) {
+ setTitle(windowTitle + ": " + title);
+ } else {
+ setTitle(CHART_TITLE + ": " + title);
+ }
+ setShowMinimizeButton(false);
+ setShowMaximizeButton(false);
+ setShowCloseButton(true);
+ setIsModal(true);
+ setShowModalMask(true);
+ setWidth(950);
+ setHeight(420);
+ setShowResizer(true);
+ setCanDragResize(true);
+ centerInPage();
+
+ addCloseClickHandler(new CloseClickHandler() {
+ @Override
+ public void onCloseClick(CloseClickEvent event) {
+ try {
+ ChartViewWindow.this.destroy();
+ portlet.refresh();
+
+ } catch (Throwable e) {
+ Log.warn("Cannot destroy chart display window.", e);
+ }
+ }
+ });
+
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index 862749d..ddd70a3 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -55,7 +55,6 @@ import org.rhq.coregui.client.dashboard.PortletViewFactory;
import org.rhq.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.coregui.client.gwt.GWTServiceLookup;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView;
-import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
import org.rhq.coregui.client.inventory.common.graph.CustomDateRangeState;
import org.rhq.coregui.client.inventory.resource.detail.monitoring.D3GraphListView;
import org.rhq.coregui.client.inventory.resource.type.ResourceTypeRepository;
@@ -240,7 +239,7 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
link.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
- window = new ChartViewWindow(title);
+ window = new ChartViewWindow(title,"", refreshablePortlet);
graphView = D3GraphListView.createSingleGraph(
resourceComposite.getResource(), md.getId(),
10 years, 5 months
[rhq] modules/common
by snegrea
modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
New commits:
commit ff5865934982c2fe369d5438164ea457a636b4b1
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Tue Nov 26 15:15:56 2013 -0600
[BZ 1035022] Allow schema specific exceptions to bubble up without being wrapped into a Runtime exception.
diff --git a/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java b/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
index ac406d5..51def78 100644
--- a/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
+++ b/modules/common/cassandra-schema/src/main/java/org/rhq/cassandra/schema/VersionManager.java
@@ -282,8 +282,14 @@ class VersionManager extends AbstractManager {
throw e1;
} catch (AuthenticationException e2) {
throw e2;
- } catch (Exception e3) {
- throw new RuntimeException(e3);
+ } catch (SchemaNotInstalledException e3) {
+ throw e3;
+ } catch (InstalledSchemaTooOldException e4) {
+ throw e4;
+ } catch (InstalledSchemaTooAdvancedException e5) {
+ throw e5;
+ } catch (Exception e6) {
+ throw new RuntimeException(e6);
} finally {
log.info("Completed storage schema compatibility check.");
}
10 years, 5 months
[rhq] modules/enterprise
by mike thompson
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java | 314 ++++-----
modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java | 317 ++++------
2 files changed, 271 insertions(+), 360 deletions(-)
New commits:
commit a532e90dd41ce1fcfb3f3d9fbdf126448ac80c1c
Author: Mike Thompson <mithomps(a)redhat.com>
Date: Tue Nov 26 12:20:40 2013 -0800
[BZ1034991] Summary Last Metrics values are different values than Chart Last Metric values.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
index 9fe962c..b3b734a 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/groups/GroupMetricsPortlet.java
@@ -68,15 +68,16 @@ import org.rhq.coregui.client.dashboard.portlets.PortletConfigurationEditorCompo
import org.rhq.coregui.client.gwt.GWTServiceLookup;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+import org.rhq.coregui.client.inventory.common.graph.CustomDateRangeState;
import org.rhq.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3GraphListView;
import org.rhq.coregui.client.inventory.groups.detail.monitoring.table.CompositeGroupD3MultiLineGraph;
import org.rhq.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.coregui.client.util.BrowserUtility;
import org.rhq.coregui.client.util.Log;
-import org.rhq.coregui.client.util.MeasurementUtility;
import org.rhq.coregui.client.util.enhanced.EnhancedVLayout;
-/**This portlet allows the end user to customize the metric display
+/**
+ * This portlet allows the end user to customize the metric display
*
* @author Simeon Pinder
*/
@@ -86,11 +87,6 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
private EntityContext context;
protected Canvas recentMeasurementsContent = new Canvas();
protected boolean currentlyLoading = false;
- protected long start = -1;
- protected long end = -1;
- protected int lastN = -1;
- protected int units = -1;
-
// A non-displayed, persisted identifier for the portlet
public static final String KEY = "GroupMetrics";
// A default displayed, persisted name for the portlet
@@ -216,46 +212,11 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
* digits.
*/
protected void getRecentMetrics() {
- final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
- final Configuration portletConfig = storedPortlet.getConfiguration();
//display container
final VLayout column = new VLayout();
column.setHeight(10);//pack
- //initialize to defaults
- end = -1;
- start = -1;
- lastN = -1;
- units = -1;
-
- //result timeframe if enabled
- PropertySimple property = portletConfig.getSimple(Constant.METRIC_RANGE_ENABLE);
- if (null != property && Boolean.valueOf(property.getBooleanValue())) {//then proceed setting
-
- boolean isAdvanced = Boolean.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_BEGIN_END_FLAG,
- Constant.METRIC_RANGE_BEGIN_END_FLAG_DEFAULT));
- if (isAdvanced) {
- //Advanced time settings
- String currentSetting = portletConfig.getSimpleValue(Constant.METRIC_RANGE,
- Constant.METRIC_RANGE_DEFAULT);
- String[] range = currentSetting.split(",");
- if (range.length == 2) {
- start = Long.valueOf(range[0]);
- end = Long.valueOf(range[1]);
- }
- } else {
- //Simple time settings
- property = portletConfig.getSimple(Constant.METRIC_RANGE_LASTN);
- if (property != null) {
- lastN = Integer.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_LASTN,
- Constant.METRIC_RANGE_LASTN_DEFAULT));
- units = Integer.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_UNIT,
- Constant.METRIC_RANGE_UNIT_DEFAULT));
- }
- }
- }
-
//locate resourceGroupRef
ResourceGroupCriteria criteria = new ResourceGroupCriteria();
criteria.addFilterId(this.groupId);
@@ -324,158 +285,151 @@ public class GroupMetricsPortlet extends EnhancedVLayout implements CustomSettin
.getId();
}
- AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>> callback = new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent metrics charting data for group ["
- + groupId + "]:" + caught.getMessage());
- setRefreshing(false);
- }
+ GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroup(
+ groupId, definitionArrayIds,
+ CustomDateRangeState.getInstance().getStartTime(),
+ CustomDateRangeState.getInstance().getEndTime(), 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving recent metrics charting data for group ["
+ + groupId + "]:" + caught.getMessage());
+ setRefreshing(false);
+ }
- @Override
- public void onSuccess(
- List<List<MeasurementDataNumericHighLowComposite>> results) {
- if (!results.isEmpty()) {
- boolean someChartedData = false;
- //iterate over the retrieved charting data
- for (int index = 0; index < displayOrder.length; index++) {
- //retrieve the correct measurement definition
- final MeasurementDefinition md = measurementDefMap
- .get(displayOrder[index]);
-
- //load the data results for the given metric definition
- List<MeasurementDataNumericHighLowComposite> data = results
- .get(index);
-
- //locate last and minimum values.
- double lastValue = -1;
- double minValue = Double.MAX_VALUE;//
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- if (d.getValue() < minValue) {
- minValue = d.getValue();
+ @Override
+ public void onSuccess(
+ List<List<MeasurementDataNumericHighLowComposite>> results) {
+ if (!results.isEmpty()) {
+ boolean someChartedData = false;
+ //iterate over the retrieved charting data
+ for (int index = 0; index < displayOrder.length; index++) {
+ //retrieve the correct measurement definition
+ final MeasurementDefinition md = measurementDefMap
+ .get(displayOrder[index]);
+
+ //load the data results for the given metric definition
+ List<MeasurementDataNumericHighLowComposite> data = results
+ .get(index);
+
+ //locate last and minimum values.
+ double lastValue = -1;
+ double minValue = Double.MAX_VALUE;//
+ for (MeasurementDataNumericHighLowComposite d : data) {
+ if ((!Double.isNaN(d.getValue()))
+ && (!String.valueOf(d.getValue()).contains("NaN"))) {
+ if (d.getValue() < minValue) {
+ minValue = d.getValue();
+ }
+ lastValue = d.getValue();
}
- lastValue = d.getValue();
}
- }
- //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
- String commaDelimitedList = "";
+ //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
+ String commaDelimitedList = "";
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (String.valueOf(d.getValue()).indexOf("NaN") == -1)) {
- commaDelimitedList += d.getValue() + ",";
+ for (MeasurementDataNumericHighLowComposite d : data) {
+ if ((!Double.isNaN(d.getValue()))
+ && (!String.valueOf(d.getValue()).contains("NaN"))) {
+ commaDelimitedList += d.getValue() + ",";
+ }
}
- }
- DynamicForm row = new DynamicForm();
- row.setNumCols(3);
- row.setColWidths(65, "*", 100);
- row.setWidth100();
- row.setAutoHeight();
- row.setOverflow(Overflow.VISIBLE);
- HTMLFlow graph = new HTMLFlow();
- // String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0'>"
- // + commaDelimitedList + "</span>";
- String contents = "<span id='sparkline_" + index
- + "' class='dynamicsparkline' width='0' " + "values='"
- + commaDelimitedList + "'>...</span>";
- graph.setContents(contents);
- graph.setContentsType(ContentsType.PAGE);
- //disable scrollbars on span
- graph.setScrollbarSize(0);
-
- CanvasItem graphContainer = new CanvasItem();
- graphContainer.setShowTitle(false);
- graphContainer.setHeight(16);
- graphContainer.setWidth(60);
- graphContainer.setCanvas(graph);
-
- final String title = md.getDisplayName();
- LinkItem link = AbstractActivityView.newLinkItem(title, null);
- link.setTooltip(title);
- link.setTitleVAlign(VerticalAlignment.TOP);
- link.setAlign(Alignment.LEFT);
- link.setClipValue(true);
- link.setWrap(true);
- link.setHeight(26);
- if(!BrowserUtility.isBrowserPreIE9()){
-
- link.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent event) {
- ChartViewWindow window = new ChartViewWindow(title);
- CompositeGroupD3GraphListView graph = new CompositeGroupD3MultiLineGraph(
- groupId, md.getId(), isAutoGroup);
- window.addItem(graph);
- graph.populateData();
- window.show();
+ DynamicForm row = new DynamicForm();
+ row.setNumCols(3);
+ row.setColWidths(65, "*", 100);
+ row.setWidth100();
+ row.setAutoHeight();
+ row.setOverflow(Overflow.VISIBLE);
+ HTMLFlow graph = new HTMLFlow();
+ // String contents = "<span id='sparkline_" + index + "' class='dynamicsparkline' width='0'>"
+ // + commaDelimitedList + "</span>";
+ String contents = "<span id='sparkline_" + index
+ + "' class='dynamicsparkline' width='0' " + "values='"
+ + commaDelimitedList + "'>...</span>";
+ graph.setContents(contents);
+ graph.setContentsType(ContentsType.PAGE);
+ //disable scrollbars on span
+ graph.setScrollbarSize(0);
+
+ CanvasItem graphContainer = new CanvasItem();
+ graphContainer.setShowTitle(false);
+ graphContainer.setHeight(16);
+ graphContainer.setWidth(60);
+ graphContainer.setCanvas(graph);
+
+ final String title = md.getDisplayName();
+ LinkItem link = AbstractActivityView.newLinkItem(title,
+ null);
+ link.setTooltip(title);
+ link.setTitleVAlign(VerticalAlignment.TOP);
+ link.setAlign(Alignment.LEFT);
+ link.setClipValue(true);
+ link.setWrap(true);
+ link.setHeight(26);
+ if (!BrowserUtility.isBrowserPreIE9()) {
+
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ ChartViewWindow window = new ChartViewWindow(
+ title);
+ CompositeGroupD3GraphListView graph = new CompositeGroupD3MultiLineGraph(
+ groupId, md.getId(), isAutoGroup);
+ window.addItem(graph);
+ graph.populateData();
+ window.show();
+ }
+ });
+ } else {
+ link.disable();
}
- });
- }else {
- link.disable();
- }
-
- //Value
- String convertedValue = AbstractActivityView
- .convertLastValueForDisplay(lastValue, md);
- StaticTextItem value = AbstractActivityView
- .newTextItem(convertedValue);
- value.setVAlign(VerticalAlignment.TOP);
- value.setAlign(Alignment.RIGHT);
- value.setWidth("100%");
-
- row.setItems(graphContainer, link, value);
- row.setWidth100();
- //if graph content returned
- if ((!md.getName().trim().contains("Trait."))
- && (lastValue != -1)) {
+ //Value
+ String convertedValue = AbstractActivityView
+ .convertLastValueForDisplay(lastValue, md);
+ StaticTextItem value = AbstractActivityView
+ .newTextItem(convertedValue);
+ value.setVAlign(VerticalAlignment.TOP);
+ value.setAlign(Alignment.RIGHT);
+ value.setWidth("100%");
+
+ row.setItems(graphContainer, link, value);
+ row.setWidth100();
+ //if graph content returned
+ if ((!md.getName().trim().contains("Trait."))
+ && (lastValue != -1)) {
+ column.addMember(row);
+ someChartedData = true;
+ }
+ }
+ if (!someChartedData) {// when there are results but no chartable entries.
+ DynamicForm row = AbstractActivityView
+ .createEmptyDisplayRow(AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
column.addMember(row);
- someChartedData = true;
+ } else {
+ //insert see more link
+ DynamicForm row = new DynamicForm();
+ String link = LinkManager
+ .getGroupMonitoringGraphsLink(context);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
}
- }
- if (!someChartedData) {// when there are results but no chartable entries.
- DynamicForm row = AbstractActivityView
- .createEmptyDisplayRow(AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
- column.addMember(row);
+ //call out to 3rd party javascript lib
+ new Timer() {
+ @Override
+ public void run() {
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(200);
+
} else {
- //insert see more link
- DynamicForm row = new DynamicForm();
- String link = LinkManager.getGroupMonitoringGraphsLink(context);
- AbstractActivityView.addSeeMoreLink(row, link, column);
+ DynamicForm row = AbstractActivityView.createEmptyDisplayRow(
+ AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
+ column.addMember(row);
}
- //call out to 3rd party javascript lib
- new Timer(){
- @Override
- public void run() {
- BrowserUtility.graphSparkLines();
- }
- }.schedule(200);
- } else {
- DynamicForm row = AbstractActivityView.createEmptyDisplayRow(
-
- AbstractActivityView.RECENT_MEASUREMENTS_GROUP_NONE);
- column.addMember(row);
+ setRefreshing(false);
}
- setRefreshing(false);
}
- };
-
- //make the asynchronous call for all the measurement data
- if (end != -1 && start != -1) {
- GWTServiceLookup.getMeasurementDataService().findDataForCompatibleGroup(
- groupId, definitionArrayIds, start, end, 60, callback);
- } else if (lastN != -1 && units != -1) {
- GWTServiceLookup.getMeasurementDataService()
- .findDataForCompatibleGroupForLast(groupId, definitionArrayIds, lastN,
- units, 60, callback);
- } else {
- GWTServiceLookup.getMeasurementDataService()
- .findDataForCompatibleGroupForLast(groupId, definitionArrayIds, 8,
- MeasurementUtility.UNIT_HOURS, 60, callback);
- }
+ );
}
});
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
index d470663..862749d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/coregui/client/dashboard/portlets/resource/ResourceMetricsPortlet.java
@@ -41,8 +41,6 @@ import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.common.EntityContext;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.PropertySimple;
import org.rhq.core.domain.criteria.ResourceCriteria;
import org.rhq.core.domain.dashboard.DashboardPortlet;
import org.rhq.core.domain.measurement.MeasurementDefinition;
@@ -54,18 +52,18 @@ import org.rhq.core.domain.util.PageList;
import org.rhq.coregui.client.LinkManager;
import org.rhq.coregui.client.dashboard.Portlet;
import org.rhq.coregui.client.dashboard.PortletViewFactory;
-import org.rhq.coregui.client.dashboard.portlets.PortletConfigurationEditorComponent.Constant;
import org.rhq.coregui.client.dashboard.portlets.groups.GroupMetricsPortlet;
import org.rhq.coregui.client.gwt.GWTServiceLookup;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView;
import org.rhq.coregui.client.inventory.common.detail.summary.AbstractActivityView.ChartViewWindow;
+import org.rhq.coregui.client.inventory.common.graph.CustomDateRangeState;
import org.rhq.coregui.client.inventory.resource.detail.monitoring.D3GraphListView;
import org.rhq.coregui.client.inventory.resource.type.ResourceTypeRepository;
import org.rhq.coregui.client.util.BrowserUtility;
import org.rhq.coregui.client.util.Log;
-import org.rhq.coregui.client.util.MeasurementUtility;
-/**This portlet allows the end user to customize the metric display
+/**
+ * This portlet allows the end user to customize the metric display
*
* @author Simeon Pinder
*/
@@ -106,45 +104,11 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
@Override
protected void getRecentMetrics() {
final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
- final Configuration portletConfig = storedPortlet.getConfiguration();
//display container
final VLayout column = new VLayout();
column.setHeight(10);//pack
column.setWidth100();
- //initialize to defaults
- end = -1;
- start = -1;
- lastN = -1;
- units = -1;
-
- //result timeframe if enabled
- PropertySimple property = portletConfig.getSimple(Constant.METRIC_RANGE_ENABLE);
- if (null != property && property.getBooleanValue()) {//then proceed setting
-
- boolean isAdvanced = Boolean.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_BEGIN_END_FLAG,
- Constant.METRIC_RANGE_BEGIN_END_FLAG_DEFAULT));
- if (isAdvanced) {
- //Advanced time settings
- String currentSetting = portletConfig.getSimpleValue(Constant.METRIC_RANGE,
- Constant.METRIC_RANGE_DEFAULT);
- String[] range = currentSetting.split(",");
- if (range.length == 2) {
- start = Long.valueOf(range[0]);
- end = Long.valueOf(range[1]);
- }
- } else {
- //Simple time settings
- property = portletConfig.getSimple(Constant.METRIC_RANGE_LASTN);
- if (property != null) {
- lastN = Integer.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_LASTN,
- Constant.METRIC_RANGE_LASTN_DEFAULT));
- units = Integer.valueOf(portletConfig.getSimpleValue(Constant.METRIC_RANGE_UNIT,
- Constant.METRIC_RANGE_UNIT_DEFAULT));
- }
- }
- }
-
//locate resource reference
ResourceCriteria criteria = new ResourceCriteria();
criteria.addFilterId(this.resourceId);
@@ -166,9 +130,8 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
final Resource resource = resourceComposite.getResource();
// Load the fully fetched ResourceType.
ResourceType resourceType = resource.getResourceType();
- ResourceTypeRepository.Cache.getInstance().getResourceTypes(
- resourceType.getId(),
- EnumSet.of(ResourceTypeRepository.MetadataType.measurements ),
+ ResourceTypeRepository.Cache.getInstance().getResourceTypes(resourceType.getId(),
+ EnumSet.of(ResourceTypeRepository.MetadataType.measurements),
new ResourceTypeRepository.TypeLoadedCallback() {
public void onTypesLoaded(ResourceType type) {
resource.setResourceType(type);
@@ -194,158 +157,152 @@ public class ResourceMetricsPortlet extends GroupMetricsPortlet {
.getId();
}
- AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>> callback = new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
- @Override
- public void onFailure(Throwable caught) {
- Log.debug("Error retrieving recent metrics charting data for resource ["
- + resourceId + "]:" + caught.getMessage());
- setRefreshing(false);
- }
+ GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId,
+ definitionArrayIds, CustomDateRangeState.getInstance().getStartTime(),
+ CustomDateRangeState.getInstance().getEndTime(), 60,
+ new AsyncCallback<List<List<MeasurementDataNumericHighLowComposite>>>() {
+ @Override
+ public void onFailure(Throwable caught) {
+ Log.debug("Error retrieving recent metrics charting data for resource ["
+ + resourceId + "]:" + caught.getMessage());
+ setRefreshing(false);
+ }
- @Override
- public void onSuccess(List<List<MeasurementDataNumericHighLowComposite>> results) {
- if (!results.isEmpty()) {
- boolean someChartedData = false;
- //iterate over the retrieved charting data
- for (int index = 0; index < displayOrder.length; index++) {
- //retrieve the correct measurement definition
- final MeasurementDefinition md = measurementDefMap
- .get(displayOrder[index]);
-
- //load the data results for the given metric definition
- List<MeasurementDataNumericHighLowComposite> data = results
- .get(index);
-
- //locate last and minimum values.
- double lastValue = -1;
- double minValue = Double.MAX_VALUE;//
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (!String.valueOf(d.getValue()).contains("NaN"))) {
- if (d.getValue() < minValue) {
- minValue = d.getValue();
+ @Override
+ public void onSuccess(
+ List<List<MeasurementDataNumericHighLowComposite>> results) {
+ if (!results.isEmpty()) {
+ boolean someChartedData = false;
+ //iterate over the retrieved charting data
+ for (int index = 0; index < displayOrder.length; index++) {
+ //retrieve the correct measurement definition
+ final MeasurementDefinition md = measurementDefMap
+ .get(displayOrder[index]);
+
+ //load the data results for the given metric definition
+ List<MeasurementDataNumericHighLowComposite> data = results
+ .get(index);
+
+ //locate last and minimum values.
+ double lastValue = -1;
+ double minValue = Double.MAX_VALUE;//
+ for (MeasurementDataNumericHighLowComposite d : data) {
+ if ((!Double.isNaN(d.getValue()))
+ && (!String.valueOf(d.getValue()).contains("NaN"))) {
+ if (d.getValue() < minValue) {
+ minValue = d.getValue();
+ }
+ lastValue = d.getValue();
}
- lastValue = d.getValue();
}
- }
- //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
- String commaDelimitedList = "";
+ //collapse the data into comma delimited list for consumption by third party javascript library(jquery.sparkline)
+ String commaDelimitedList = "";
- for (MeasurementDataNumericHighLowComposite d : data) {
- if ((!Double.isNaN(d.getValue()))
- && (!String.valueOf(d.getValue()).contains("NaN"))) {
- commaDelimitedList += d.getValue() + ",";
- }
- }
- DynamicForm row = new DynamicForm();
- row.setNumCols(3);
- row.setColWidths(65, "*", 100);
- row.setWidth100();
- row.setAutoHeight();
- row.setOverflow(Overflow.VISIBLE);
- HTMLFlow sparklineGraph = new HTMLFlow();
- String contents = "<span id='sparkline_" + index
- + "' class='dynamicsparkline' width='0' " + "values='"
- + commaDelimitedList + "'>...</span>";
- sparklineGraph.setContents(contents);
- sparklineGraph.setContentsType(ContentsType.PAGE);
- //disable scrollbars on span
- sparklineGraph.setScrollbarSize(0);
-
- CanvasItem sparklineContainer = new CanvasItem();
- sparklineContainer.setShowTitle(false);
- sparklineContainer.setHeight(16);
- sparklineContainer.setWidth(60);
- sparklineContainer.setCanvas(sparklineGraph);
-
- //Link/title element
- final String title = md.getDisplayName();
- LinkItem link = AbstractActivityView.newLinkItem(title, null);
- link.setTooltip(title);
- link.setTitleVAlign(VerticalAlignment.TOP);
- link.setAlign(Alignment.LEFT);
- link.setClipValue(true);
- link.setWrap(true);
- link.setHeight(26);
- link.setWidth("100%");
- if(!BrowserUtility.isBrowserPreIE9()){
- link.addClickHandler(new ClickHandler() {
- @Override
- public void onClick(ClickEvent event) {
- window = new ChartViewWindow(title);
-
- graphView = D3GraphListView
- .createSingleGraph(resourceComposite.getResource(),
- md.getId(), true);
-
- window.addItem(graphView);
- window.show();
+ for (MeasurementDataNumericHighLowComposite d : data) {
+ if ((!Double.isNaN(d.getValue()))
+ && (!String.valueOf(d.getValue()).contains("NaN"))) {
+ commaDelimitedList += d.getValue() + ",";
}
- });
- }else{
- link.disable();
- }
-
-
- //Value
- String convertedValue;
- convertedValue = AbstractActivityView.convertLastValueForDisplay(
- lastValue, md);
- StaticTextItem value = AbstractActivityView
- .newTextItem(convertedValue);
- value.setVAlign(VerticalAlignment.TOP);
- value.setAlign(Alignment.RIGHT);
+ }
+ DynamicForm row = new DynamicForm();
+ row.setNumCols(3);
+ row.setColWidths(65, "*", 100);
+ row.setWidth100();
+ row.setAutoHeight();
+ row.setOverflow(Overflow.VISIBLE);
+ HTMLFlow sparklineGraph = new HTMLFlow();
+ String contents = "<span id='sparkline_" + index
+ + "' class='dynamicsparkline' width='0' " + "values='"
+ + commaDelimitedList + "'>...</span>";
+ sparklineGraph.setContents(contents);
+ sparklineGraph.setContentsType(ContentsType.PAGE);
+ //disable scrollbars on span
+ sparklineGraph.setScrollbarSize(0);
+
+ CanvasItem sparklineContainer = new CanvasItem();
+ sparklineContainer.setShowTitle(false);
+ sparklineContainer.setHeight(16);
+ sparklineContainer.setWidth(60);
+ sparklineContainer.setCanvas(sparklineGraph);
+
+ //Link/title element
+ final String title = md.getDisplayName();
+ LinkItem link = AbstractActivityView.newLinkItem(title, null);
+ link.setTooltip(title);
+ link.setTitleVAlign(VerticalAlignment.TOP);
+ link.setAlign(Alignment.LEFT);
+ link.setClipValue(true);
+ link.setWrap(true);
+ link.setHeight(26);
+ link.setWidth("100%");
+ if (!BrowserUtility.isBrowserPreIE9()) {
+ link.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ window = new ChartViewWindow(title);
+
+ graphView = D3GraphListView.createSingleGraph(
+ resourceComposite.getResource(), md.getId(),
+ true);
+
+ window.addItem(graphView);
+ window.show();
+ }
+ });
+ } else {
+ link.disable();
+ }
- row.setItems(sparklineContainer, link, value);
- row.setWidth100();
+ //Value
+ String convertedValue;
+ convertedValue = AbstractActivityView
+ .convertLastValueForDisplay(lastValue, md);
+ StaticTextItem value = AbstractActivityView
+ .newTextItem(convertedValue);
+ value.setVAlign(VerticalAlignment.TOP);
+ value.setAlign(Alignment.RIGHT);
+
+ row.setItems(sparklineContainer, link, value);
+ row.setWidth100();
+
+ //if graph content returned
+ if ((!md.getName().trim().contains("Trait."))
+ && (lastValue != -1)) {
+ column.addMember(row);
+ someChartedData = true;
+ }
+ }
+ if (!someChartedData) {// when there are results but no chartable entries.
+ DynamicForm row = AbstractActivityView.createEmptyDisplayRow(
- //if graph content returned
- if ((!md.getName().trim().contains("Trait.")) && (lastValue != -1)) {
+ AbstractActivityView.RECENT_MEASUREMENTS_NONE);
column.addMember(row);
- someChartedData = true;
+ } else {
+ //insert see more link
+ DynamicForm row = new DynamicForm();
+ String link = LinkManager
+ .getResourceMonitoringGraphsLink(resourceId);
+ AbstractActivityView.addSeeMoreLink(row, link, column);
}
- }
- if (!someChartedData) {// when there are results but no chartable entries.
- DynamicForm row = AbstractActivityView.createEmptyDisplayRow(
-
- AbstractActivityView.RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
+ //call out to 3rd party javascript lib
+ new Timer() {
+ @Override
+ public void run() {
+ BrowserUtility.graphSparkLines();
+ }
+ }.schedule(200);
} else {
- //insert see more link
- DynamicForm row = new DynamicForm();
- String link = LinkManager
- .getResourceMonitoringGraphsLink(resourceId);
- AbstractActivityView.addSeeMoreLink(row, link, column);
+ DynamicForm row = AbstractActivityView
+ .createEmptyDisplayRow(AbstractActivityView.RECENT_MEASUREMENTS_NONE);
+ column.addMember(row);
}
- //call out to 3rd party javascript lib
- new Timer(){
- @Override
- public void run() {
- BrowserUtility.graphSparkLines();
- }
- }.schedule(200);
- } else {
- DynamicForm row = AbstractActivityView
- .createEmptyDisplayRow(AbstractActivityView.RECENT_MEASUREMENTS_NONE);
- column.addMember(row);
+ setRefreshing(false);
}
- setRefreshing(false);
}
- };
-
- //make the asynchronous call for all the measurement data
- if (end != -1 && start != -1) {
- GWTServiceLookup.getMeasurementDataService().findDataForResource(resourceId,
- definitionArrayIds, start, end, 60, callback);
- } else if (lastN != -1 && units != -1) {
- GWTServiceLookup.getMeasurementDataService().findDataForResourceForLast(
- resourceId, definitionArrayIds, lastN, units, 60, callback);
- } else {
- GWTServiceLookup.getMeasurementDataService().findDataForResourceForLast(
- resourceId, definitionArrayIds, 8, MeasurementUtility.UNIT_HOURS, 60,
- callback);
- }
+
+ );
+
}
});
}
10 years, 5 months
[rhq] Branch 'jay-avail' - modules/core
by mazz
modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java | 18 ++++------
1 file changed, 8 insertions(+), 10 deletions(-)
New commits:
commit 61bf3197f0d32f2c53e855eb074da662b2e23d1c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Nov 26 15:15:00 2013 -0500
fix logging so its not too noisy
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
index 9fada2c..40edfa7 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/AvailabilityProxy.java
@@ -177,9 +177,10 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
} else if (availAsyncConsecutiveTimeouts == AVAIL_SYNC_TIMEOUT_LIMIT) {
// log one time that we are disabling synchronous checks for this resource
++availAsyncConsecutiveTimeouts;
- // TODO: SHOULD THIS BE DEBUG? (must be same as enable message above)
- log.info("Disabling synchronous availability collection for " + resourceComponent + "; ["
- + AVAIL_SYNC_TIMEOUT_LIMIT + "] consective timeouts exceeding [" + AVAIL_SYNC_TIMEOUT + "ms]");
+ if (log.isDebugEnabled()) {
+ log.debug("Disabling synchronous availability collection for [" + resourceComponent + "]; ["
+ + AVAIL_SYNC_TIMEOUT_LIMIT + "] consective timeouts exceeding [" + AVAIL_SYNC_TIMEOUT + "ms]");
+ }
}
} catch (InterruptedException e) {
log.debug("InterruptedException; shut down is (likely) in progress.");
@@ -194,9 +195,6 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
} catch (java.util.concurrent.TimeoutException e) {
// failed to get avail synchronously. next call to the future will return availability (we hope)
++availAsyncConsecutiveTimeouts;
-
- // TODO: REMOVE THIS DEV LOGGING!!
- log.warn("AVAIL CHECK TIMEOUT! " + resourceComponent);
}
return processAvail(avail);
@@ -221,11 +219,11 @@ public class AvailabilityProxy implements AvailabilityFacet, Callable<Availabili
// resource comes up we should give it a chance to respond quickly and provide live avail.
if (result != last) {
if (result == UP) {
-
- // TODO: SHOULD THIS BE DEBUG? (must be same as disable message above)
if (availAsyncConsecutiveTimeouts >= AVAIL_SYNC_TIMEOUT_LIMIT) {
- log.info("Enabling synchronous availability collection for " + resourceComponent
- + "; Availability has just changed from [" + last.name() + "] to UP.");
+ if (log.isDebugEnabled()) {
+ log.debug("Enabling synchronous availability collection for [" + resourceComponent
+ + "]; Availability has just changed from [" + last + "] to UP.");
+ }
}
availAsyncConsecutiveTimeouts = 0;
10 years, 5 months
[rhq] modules/plugins
by Thomas Segismont
modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml | 37 +++++-----
1 file changed, 21 insertions(+), 16 deletions(-)
New commits:
commit d28e22f0c77f127efe6ff3f63f0f82e22c20083a
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Tue Nov 26 18:52:31 2013 +0100
Bug 1034218 - EAR subdeployments are not discovered for DomainDeployment
diff --git a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
index 26bc08f..39aa818 100644
--- a/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
+++ b/modules/plugins/jboss-as-7/src/main/resources/META-INF/rhq-plugin.xml
@@ -8870,10 +8870,10 @@
<c:simple-property name="archive" type="boolean" readOnly="true" required="false" description="Flag indicating whether unmanaged content is a zip archive (true) or exploded (false)."/>
</c:map-property>
</c:list-property>
- <c:simple-property name="enabled" required="true" type="boolean" readOnly="true" description="Boolean indicating whether the deployment content is currently deployed in the runtime (or should be deployed in the runtime the next time the server starts.)"/>
- <c:simple-property name="name" required="true" type="string" readOnly="true" description="Unique identifier of the deployment. Must be unique across all deployments."/>
- <c:simple-property name="persistent" required="true" type="boolean" readOnly="true" description="Boolean indicating whether the existence of the deployment should be recorded in the persistent server configuration. Only relevant to a standalone mode server. Default is 'true'. A deployment managed by a deployment scanner would have this set to 'false' to ensure the deployment is only deployed at server start if the scanner again detects the deployment."/>
- <c:simple-property name="runtime-name" required="true" type="string" readOnly="true" description="Name by which the deployment should be known within a server runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same as 'name', but in some cases users may wish to have two deployments with the same runtime-name (e.g. two versions of foo.war) both available in the deployment content repository, in which case the deployments would need to have distinct name; values but would have the same runtime-name."/>
+ <c:simple-property name="enabled" required="false" type="boolean" readOnly="true" description="Boolean indicating whether the deployment content is currently deployed in the runtime (or should be deployed in the runtime the next time the server starts.)"/>
+ <c:simple-property name="name" required="false" type="string" readOnly="true" description="Unique identifier of the deployment. Must be unique across all deployments."/>
+ <c:simple-property name="persistent" required="false" type="boolean" readOnly="true" description="Boolean indicating whether the existence of the deployment should be recorded in the persistent server configuration. Only relevant to a standalone mode server. Default is 'true'. A deployment managed by a deployment scanner would have this set to 'false' to ensure the deployment is only deployed at server start if the scanner again detects the deployment."/>
+ <c:simple-property name="runtime-name" required="false" type="string" readOnly="true" description="Name by which the deployment should be known within a server runtime. This would be equivalent to the file name of a deployment file, and would form the basis for such things as default Java Enterprise Edition application and module names. This would typically be the same as 'name', but in some cases users may wish to have two deployments with the same runtime-name (e.g. two versions of foo.war) both available in the deployment content repository, in which case the deployments would need to have distinct name; values but would have the same runtime-name."/>
</resource-configuration>
</service>
@@ -8953,6 +8953,7 @@
<runs-inside>
<parent-resource-type name="Deployment" plugin="&pluginName;"/>
<parent-resource-type name="Subdeployment" plugin="&pluginName;"/>
+ <parent-resource-type name="ManagedServerDeployment" plugin="&pluginName;"/>
</runs-inside>
<plugin-configuration>
@@ -8993,7 +8994,7 @@
<c:simple-property name="background-validation-millis" required="false" type="long" readOnly="true" description="The background-validation-millis element specifies the amount of time, in milliseconds, that background validation will run. Changing this value can be done only on disabled datasource, requires a server restart otherwise"/>
<c:simple-property name="blocking-timeout-wait-millis" required="false" type="long" readOnly="true" description="The blocking-timeout-millis element specifies the maximum time, in milliseconds, to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for locking a connection, and will never throw an exception if creating a new connection takes an inordinately long time"/>
<c:simple-property name="check-valid-connection-sql" required="false" type="string" readOnly="true" description="Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is obtained from the pool"/>
- <c:simple-property name="driver-name" required="true" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit"/>
+ <c:simple-property name="driver-name" required="false" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit"/>
<c:simple-property name="enabled" required="false" type="boolean" readOnly="true" description="Specifies if the datasource should be enabled"/>
<c:simple-property name="exception-sorter-class-name" required="false" type="string" readOnly="true" description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides an isExceptionFatal(SQLException) method to validate if an exception should broadcast an error"/>
<c:map-property name="exception-sorter-properties" description="The exception sorter properties">
@@ -9008,7 +9009,7 @@
</c:simple-property>
<c:simple-property name="idle-timeout-minutes" required="false" type="long" readOnly="true" description="The idle-timeout-minutes elements specifies the maximum time, in minutes, a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is half of the smallest idle-timeout-minutes value of any pool. Changing this value can be done only on disabled datasource, requires a server restart otherwise."/>
<c:simple-property name="interleaving" required="false" type="boolean" readOnly="true" defaultValue="false" description="An element to enable interleaving for XA connections. The default value is false."/>
- <c:simple-property name="jndi-name" required="true" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
+ <c:simple-property name="jndi-name" required="false" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
<c:simple-property name="jta" required="false" type="boolean" readOnly="true" defaultValue="true" description="Enable JTA integration. The default value is true."/>
<c:simple-property name="max-pool-size" required="false" type="integer" readOnly="true" defaultValue="20" description="The max-pool-size element specifies the maximum number of connections for a pool. No more connections will be created in each sub-pool. The default value is 20."/>
<c:simple-property name="min-pool-size" required="false" type="integer" readOnly="true" defaultValue="0" description="The min-pool-size element specifies the minimum number of connections for a pool. The default value is 0."/>
@@ -9116,10 +9117,10 @@
<c:simple-property name="background-validation-millis" required="false" type="long" readOnly="true" description="The background-validation-millis element specifies the amount of time, in milliseconds, that background validation will run. Changing this value can be done only on disabled datasource, requires a server restart otherwise"/>
<c:simple-property name="blocking-timeout-wait-millis" required="false" type="long" readOnly="true" description="The blocking-timeout-millis element specifies the maximum time, in milliseconds, to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for locking a connection, and will never throw an exception if creating a new connection takes an inordinately long time"/>
<c:simple-property name="check-valid-connection-sql" required="false" type="string" readOnly="true" description="Specify an SQL statement to check validity of a pool connection. This may be called when managed connection is obtained from the pool"/>
- <c:simple-property name="connection-url" required="true" type="string" readOnly="true" description="The JDBC driver connection URL"/>
+ <c:simple-property name="connection-url" required="false" type="string" readOnly="true" description="The JDBC driver connection URL"/>
<c:simple-property name="datasource-class" required="false" type="string" readOnly="true" description="The fully qualifed name of the JDBC datasource class"/>
<c:simple-property name="driver-class" required="false" type="string" readOnly="true" description="The fully qualifed name of the JDBC driver class"/>
- <c:simple-property name="driver-name" required="true" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit"/>
+ <c:simple-property name="driver-name" required="false" type="string" readOnly="true" description="Defines the JDBC driver the datasource should use. It is a symbolic name matching the the name of installed driver. In case the driver is deployed as jar, the name is the name of deployment unit"/>
<c:simple-property name="enabled" required="false" type="boolean" readOnly="true" description="Specifies if the datasource should be enabled"/>
<c:simple-property name="exception-sorter-class-name" required="false" type="string" readOnly="true" description="An org.jboss.jca.adapters.jdbc.ExceptionSorter that provides an isExceptionFatal(SQLException) method to validate if an exception should broadcast an error"/>
<c:map-property name="exception-sorter-properties" description="The exception sorter properties">
@@ -9133,7 +9134,7 @@
</c:property-options>
</c:simple-property>
<c:simple-property name="idle-timeout-minutes" required="false" type="long" readOnly="true" description="The idle-timeout-minutes elements specifies the maximum time, in minutes, a connection may be idle before being closed. The actual maximum time depends also on the IdleRemover scan time, which is half of the smallest idle-timeout-minutes value of any pool. Changing this value can be done only on disabled datasource, requires a server restart otherwise."/>
- <c:simple-property name="jndi-name" required="true" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
+ <c:simple-property name="jndi-name" required="false" type="string" readOnly="true" description="Specifies the JNDI name for the datasource"/>
<c:simple-property name="jta" required="false" type="boolean" readOnly="true" defaultValue="true" description="Enable JTA integration. The default value is true."/>
<c:simple-property name="max-pool-size" required="false" type="integer" readOnly="true" defaultValue="20" description="The max-pool-size element specifies the maximum number of connections for a pool. No more connections will be created in each sub-pool. The default value is 20."/>
<c:simple-property name="min-pool-size" required="false" type="integer" readOnly="true" defaultValue="0" description="The min-pool-size element specifies the minimum number of connections for a pool. The default value is 0."/>
@@ -9200,6 +9201,7 @@
<runs-inside>
<parent-resource-type name="Deployment" plugin="&pluginName;"/>
<parent-resource-type name="Subdeployment" plugin="&pluginName;"/>
+ <parent-resource-type name="ManagedServerDeployment" plugin="&pluginName;"/>
</runs-inside>
<plugin-configuration>
@@ -9663,7 +9665,7 @@
<metric property="temporary" dataType="trait" description="Whether the queue is temporary."/>
<resource-configuration>
- <c:list-property name="entries" required="true" readOnly="true" description="The jndi names the queue will be bound to.">
+ <c:list-property name="entries" required="false" readOnly="true" description="The jndi names the queue will be bound to.">
<c:simple-property name="entry" type="string" description="A single JNDI entry"/>
</c:list-property>
</resource-configuration>
@@ -9780,7 +9782,7 @@
<metric property="topic-address" dataType="trait" description="The address the topic points to."/>
<resource-configuration>
- <c:list-property name="entries" required="true" readOnly="true" displayName="JNDI Names" description="The jndi names the queue will be bound to.">
+ <c:list-property name="entries" required="false" readOnly="true" displayName="JNDI Names" description="The jndi names the queue will be bound to.">
<c:simple-property name="entry" type="string" description="A single JNDI entry"/>
</c:list-property>
</resource-configuration>
@@ -9799,6 +9801,7 @@
<runs-inside>
<parent-resource-type name="Deployment" plugin="&pluginName;"/>
<parent-resource-type name="Subdeployment" plugin="&pluginName;"/>
+ <parent-resource-type name="ManagedServerDeployment" plugin="&pluginName;"/>
</runs-inside>
<plugin-configuration>
@@ -9997,6 +10000,7 @@
<runs-inside>
<parent-resource-type name="Deployment" plugin="&pluginName;"/>
<parent-resource-type name="Subdeployment" plugin="&pluginName;"/>
+ <parent-resource-type name="ManagedServerDeployment" plugin="&pluginName;"/>
</runs-inside>
<plugin-configuration>
@@ -10021,11 +10025,11 @@
<metric property="total-processing-time" description="Total endpoint processing time."/>
<resource-configuration>
- <c:simple-property name="class" required="true" type="string" readOnly="true" description="Webservice endpoint class."/>
- <c:simple-property name="context" required="true" type="string" readOnly="true" description="Webservice endpoint context."/>
- <c:simple-property name="name" required="true" type="string" readOnly="true" description="Webservice endpoint name."/>
- <c:simple-property name="type" required="true" type="string" readOnly="true" description="Webservice endpoint type."/>
- <c:simple-property name="wsdl-url" required="true" type="string" readOnly="true" description="Webservice endpoint WSDL URL."/>
+ <c:simple-property name="class" required="false" type="string" readOnly="true" description="Webservice endpoint class."/>
+ <c:simple-property name="context" required="false" type="string" readOnly="true" description="Webservice endpoint context."/>
+ <c:simple-property name="name" required="false" type="string" readOnly="true" description="Webservice endpoint name."/>
+ <c:simple-property name="type" required="false" type="string" readOnly="true" description="Webservice endpoint type."/>
+ <c:simple-property name="wsdl-url" required="false" type="string" readOnly="true" description="Webservice endpoint WSDL URL."/>
</resource-configuration>
</service>
@@ -10041,6 +10045,7 @@
<runs-inside>
<parent-resource-type name="Deployment" plugin="&pluginName;"/>
<parent-resource-type name="Subdeployment" plugin="&pluginName;"/>
+ <parent-resource-type name="ManagedServerDeployment" plugin="&pluginName;"/>
</runs-inside>
<plugin-configuration>
10 years, 5 months