modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
| 4 +-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentServerPluginContainer.java
| 14 +++-------
2 files changed, 7 insertions(+), 11 deletions(-)
New commits:
commit 18f435db715beeecf08b8c3ffd2802364b1fcde3
Author: Jason Dobies <jason.dobies(a)redhat.com>
Date: Mon Nov 30 16:11:20 2009 -0500
Renamed sync job scheduling methods due to different types of sync jobs that can be
scheduled.
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
index 0a1a148..1cabd8d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java
@@ -426,7 +426,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
pc.getAdapterManager().startAdapter(contentSource);
// Schedule a job for the future
- pc.scheduleSyncJob(contentSource);
+ pc.scheduleProviderSyncJob(contentSource);
// Also sync immediately so we have the metadata
pc.syncNow(contentSource);
@@ -494,7 +494,7 @@ public class ContentSourceManagerBean implements
ContentSourceManagerLocal {
ContentServerPluginContainer pc = ContentManagerHelper.getPluginContainer();
pc.unscheduleSyncJob(contentSource);
pc.getAdapterManager().restartAdapter(contentSource);
- pc.scheduleSyncJob(contentSource);
+ pc.scheduleProviderSyncJob(contentSource);
pc.syncNow(contentSource);
} catch (Exception e) {
log.warn("Failed to restart adapter for [" + contentSource +
"]", e);
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentServerPluginContainer.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentServerPluginContainer.java
index 9eb014e..6204e28 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentServerPluginContainer.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/content/ContentServerPluginContainer.java
@@ -75,7 +75,7 @@ public class ContentServerPluginContainer extends
AbstractTypeServerPluginContai
@Override
public void schedulePluginJobs() throws Exception {
super.schedulePluginJobs();
- scheduleSyncJobs();
+ scheduleProviderSyncJobs();
return;
}
@@ -135,11 +135,11 @@ public class ContentServerPluginContainer extends
AbstractTypeServerPluginContai
* <p>If the content source's sync schedule is empty, this method assumes
it should not be automatically sync'ed so
* no schedule will be created and this method simply returns.</p>
*
- * @param contentSource
+ * @param contentSource provider to sync
*
* @throws SchedulerException if failed to schedule the job
*/
- public void scheduleSyncJob(ContentSource contentSource) throws SchedulerException {
+ public void scheduleProviderSyncJob(ContentSource contentSource) throws
SchedulerException {
String syncSchedule = contentSource.getSyncSchedule();
if ((syncSchedule == null) || (syncSchedule.trim().length() == 0)) {
getLog().debug(contentSource.toString() + " does not define a sync
schedule - not scheduling");
@@ -150,26 +150,22 @@ public class ContentServerPluginContainer extends
AbstractTypeServerPluginContai
scheduler.scheduleCronJob(ContentProviderSyncJob.createJobName(contentSource),
SYNC_JOB_GROUP_NAME,
ContentProviderSyncJob.createJobDataMap(contentSource, null),
ContentProviderSyncJob.class, true, false,
syncSchedule);
-
- return;
}
/**
* It will schedule one job per adapter such that each adapter is scheduled to be
synchronized as per its defined
* sync schedule. This must only be called when all content source adapters have been
initialized.
*/
- public void scheduleSyncJobs() {
+ public void scheduleProviderSyncJobs() {
if (this.adapterManager != null) {
for (ContentSource contentSource :
this.adapterManager.getAllContentSources()) {
try {
- scheduleSyncJob(contentSource);
+ scheduleProviderSyncJob(contentSource);
} catch (Exception e) {
getLog().warn("Could not schedule sync job for content source
[" + contentSource + "]", e);
}
}
}
-
- return;
}
/**
Show replies by date