<!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] [3605] don't schedule periodic avail scans if not running inside Agent - we don't want them in EmbJopr (http://jira.rhq-project.org/browse/RHQ-1919)</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>3605</dd> <dt>Author</dt> <dd>ispringer</dd> <dt>Date</dt> <dd>2009-04-03 13:07:12 -0500 (Fri, 03 Apr 2009)</dd> </dl> <h3>Log Message</h3> <pre>don't schedule periodic avail scans if not running inside Agent - we don't want them in EmbJopr (http://jira.rhq-project.org/browse/RHQ-1919)</pre> <h3>Modified Paths</h3> <ul> <li><a href="#rhqtrunkmodulescoreplugincontainersrcmainjavaorgrhqcorepcinventoryInventoryManagerjava">rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java</a></li> </ul> </div> <div id="patch"> <h3>Diff</h3> <a id="rhqtrunkmodulescoreplugincontainersrcmainjavaorgrhqcorepcinventoryInventoryManagerjava"></a> <div class="modfile"><h4>Modified: rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java (3604 => 3605)</h4> <pre class="diff"> <span class="info">--- rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java 2009-04-03 16:16:18 UTC (rev 3604) +++ rhq/trunk/modules/core/plugin-container/src/main/java/org/rhq/core/pc/inventory/InventoryManager.java 2009-04-03 18:07:12 UTC (rev 3605) </span><span class="lines">@@ -184,33 +184,35 @@ </span><span class="cx"> loadFromDisk(); } </span><span class="add">+ // Discover the platform first thing. </span><span class="cx"> executePlatformScan(); </span><span class="rem">- // Never run more than one discovery at a time. </span><span class="add">+ // Never run more than one avail check at a time. + availabilityThreadPoolExecutor = new ScheduledThreadPoolExecutor(AVAIL_THREAD_POOL_CORE_POOL_SIZE, + new LoggingThreadFactory(AVAIL_THREAD_POOL_NAME, true)); + availabilityExecutor = new AvailabilityExecutor(this); + + // Never run more than one discovery scan at a time (service and service scans share the same pool). </span><span class="cx"> inventoryThreadPoolExecutor = new ScheduledThreadPoolExecutor(1, new LoggingThreadFactory( INVENTORY_THREAD_POOL_NAME, true)); </span><span class="rem">- </span><span class="cx"> serverScanExecutor = new AutoDiscoveryExecutor(null, this, configuration); </span><span class="add">+ serviceScanExecutor = new RuntimeDiscoveryExecutor(this, configuration); </span><span class="cx"> </span><span class="rem">- // After ten seconds, periodically run the autodiscovery scan </span><span class="add">+ // Only schedule periodic discovery scans and avail checks if we are running inside the RHQ Agent (versus + // inside EmbJopr). + if (configuration.isInsideAgent()) { + // After an initial delay (5s by default), periodically run an availability check (every 1m by default). + availabilityThreadPoolExecutor.scheduleWithFixedDelay(availabilityExecutor, configuration + .getAvailabilityScanInitialDelay(), configuration.getAvailabilityScanPeriod(), TimeUnit.SECONDS); </span><span class="cx"> </span><span class="rem">- if (configuration.isInsideAgent()) { </span><span class="add">+ // After an initial delay (10s by default), periodically run a server discovery scan (every 15m by default). </span><span class="cx"> inventoryThreadPoolExecutor.scheduleWithFixedDelay(serverScanExecutor, configuration .getServerDiscoveryInitialDelay(), configuration.getServerDiscoveryPeriod(), TimeUnit.SECONDS); </span><span class="rem">- } </span><span class="cx"> </span><span class="rem">- serviceScanExecutor = new RuntimeDiscoveryExecutor(this, configuration); - if (configuration.isInsideAgent()) { </span><span class="add">+ // After an initial delay (20s by default), periodically run a service discovery scan (every 1d by default). </span><span class="cx"> inventoryThreadPoolExecutor.scheduleWithFixedDelay(serviceScanExecutor, configuration .getServiceDiscoveryInitialDelay(), configuration.getServiceDiscoveryPeriod(), TimeUnit.SECONDS); } </span><span class="rem">- - // Never run more than one availability check at a time. - availabilityThreadPoolExecutor = new ScheduledThreadPoolExecutor(AVAIL_THREAD_POOL_CORE_POOL_SIZE, - new LoggingThreadFactory(AVAIL_THREAD_POOL_NAME, true)); - availabilityExecutor = new AvailabilityExecutor(this); - availabilityThreadPoolExecutor.scheduleWithFixedDelay(availabilityExecutor, configuration - .getAvailabilityScanInitialDelay(), configuration.getAvailabilityScanPeriod(), TimeUnit.SECONDS); </span><span class="cx"> } finally { inventoryLock.writeLock().unlock(); } </span> </pre> </div> </div> </body> </html> |