From: <hr...@rh...> - 2009-01-23 10:50:31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><style type="text/css"><!-- #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } #msg DL { border : 1px #006 solid; background-color : #369; padding : 6px; color : #fff; } #msg DT { float : left; width : 6em; font-weight : bold; } #msg DL, #msg DT, #msg UL, #msg LI { font-family : arial,helvetica,sans-serif; font-size : 10pt; } h3 { font-family : arial,helvetica,sans-serif; font-size : 10pt; font-weight : bold; } #msg PRE { overflow : auto; white-space : normal; background-color : #ffc; border : 1px #fc0 solid; padding : 6px; } #msg UL, PRE, .diff { overflow : auto; } #patch h4 { font-family : arial,helvetica,sans-serif; font-size : 10pt; } #patch h4 { padding: 8px; background : #369; color : #fff; margin : 0; } #patch .propset h4, #patch .binary h4 {margin: 0;} #patch pre {padding:0;line-height:1.2em;margin:0;} #patch .diff {background:#eeeeee;padding: 0 0 10px 0;} #patch .propset .diff, #patch .binary .diff {padding: 10px 0;} #patch span {display:block;padding:0 10px;} #patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;} #patch .add {background:#ddffdd;} #patch .rem {background:#ffdddd;} #patch .lines, .info {color:#888888;background:#ffffff;} .diff { width : 100%; } --></style> <title>[rhq-project.org rhq] [2717] Small cleanup</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>2717</dd> <dt>Author</dt> <dd>hrupp</dd> <dt>Date</dt> <dd>2009-01-23 04:50:28 -0600 (Fri, 23 Jan 2009)</dd> </dl> <h3>Log Message</h3> <pre>Small cleanup</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulescoreplugincontainersrcmainjavaorgrhqcorepcmeasurementMeasurementManagerjava">rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulescoreplugincontainersrcmainjavaorgrhqcorepcmeasurementMeasurementManagerjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java (2716 => 2717)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java 2009-01-23 09:23:54 UTC (rev 2716) +++ rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/measurement/MeasurementManager.java 2009-01-23 10:50:28 UTC (rev 2717) </span><span class="lines">@@ -278,9 +278,9 @@ </span><span class="cx"> /** * This remoted method allows the server to schedule a bunch of resources with one call. </span><span class="rem">- * </span><span class="add">+ * </span><span class="cx"> * This method will update the set of {@link MeasurementSchedule}s in the agent. </span><span class="rem">- * </span><span class="add">+ * </span><span class="cx"> * Use {@link #scheduleCollection(Set)} if you want to replace the existing ones. * * @param scheduleRequests </span><span class="lines">@@ -313,9 +313,9 @@ </span><span class="cx"> /** * This remoted method allows the server to schedule a bunch of resources with one call. </span><span class="rem">- * </span><span class="add">+ * </span><span class="cx"> * BE CAREFUL, as this will replace all existing schedules with the passed set. </span><span class="rem">- * </span><span class="add">+ * </span><span class="cx"> * Use {@link #updateCollection(Set)} if you want to schedule additional {@link MeasurementSchedule}s * * @param scheduleRequests </span><span class="lines">@@ -354,7 +354,7 @@ </span><span class="cx"> // This ensures that all the schedules for a single resource start at the same time // This will enable them to be collected at the same time long firstCollection = System.currentTimeMillis(); </span><span class="rem">- InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager(); </span><span class="add">+ </span><span class="cx"> for (MeasurementScheduleRequest request : requests) { ScheduledMeasurementInfo info = new ScheduledMeasurementInfo(request, resourceId); </span><span class="lines">@@ -401,8 +401,12 @@ </span><span class="cx"> public Set<MeasurementData> getRealTimeMeasurementValue(int resourceId, DataType dataType, String... measurementName) { MeasurementFacet measurementFacet; </span><span class="rem">- Resource resource = PluginContainer.getInstance().getInventoryManager().getResourceContainer(resourceId) - .getResource(); </span><span class="add">+ ResourceContainer resCont = PluginContainer.getInstance().getInventoryManager().getResourceContainer(resourceId); + if (resCont == null) { + LOG.warn("Can not get resource container for resource with id " + resourceId); + return null; + } + Resource resource = resCont.getResource(); </span><span class="cx"> ResourceType resourceType = resource.getResourceType(); if (resourceType.getMetricDefinitions().isEmpty()) return Collections.emptySet(); </span> </pre> </div> </div> </body> </html> |