}
//add all IndexingSources that need to be initialised to a set
final Collection<IndexingComponent> toInitialise = new HashSet<IndexingComponent>();
//we need an simple listener that removes the IndexingSerouces from the
//above list
final IndexingSourceInitialiserListener listener = new IndexingSourceInitialiserListener() {
@Override
public void indexingSourceInitialised(IndexingSourceEventObject eventObject) {
//remove the IndexingSource from the toInitialise set
synchronized (toInitialise) {
toInitialise.remove(eventObject.getIndexingSource());