Added addKeywordListToAllJobs method

This commit is contained in:
Samuel H. Kenyon 2014-03-31 18:06:48 -04:00
parent c4cf08fb42
commit ed9c83acf5

View File

@ -125,6 +125,19 @@ public final class SearchRunner {
doFinalSearch(copy);
}
/**
* Add this list to all of the jobs
* @param keywordListName
*/
public void addKeywordListToAllJobs(String keywordListName) {
logger.log(Level.INFO, "Adding keyword list {0} to all jobs", keywordListName);
synchronized(this) {
for(Entry<Long, SearchJobInfo> j : jobs.entrySet()) {
j.getValue().getKeywordListNames().add(keywordListName);
}
}
}
/**
* Commits index and notifies listeners of index update
*/
@ -175,11 +188,11 @@ public final class SearchRunner {
@Override
public void actionPerformed(ActionEvent e) {
commit();
logger.log(Level.INFO, "Launching searchers");
synchronized(SearchRunner.this) {
// Spawn a search thread for each job
///@todo Don't spawn a new thread if a job still has the previous one running
logger.log(Level.INFO, "Launching searchers");
for(Entry<Long, SearchJobInfo> j : jobs.entrySet()) {
SearchJobInfo copy = new SearchJobInfo(j.getValue());
Searcher s = new Searcher(copy, true);