Example usage for org.apache.lucene.analysis.util ResourceLoaderAware inform

List of usage examples for org.apache.lucene.analysis.util ResourceLoaderAware inform

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.util ResourceLoaderAware inform.

Prototype

void inform(ResourceLoader loader) throws IOException;

Source Link

Document

Initializes this component with the provided ResourceLoader (used for loading classes, files, etc).

Usage

From source file:org.apache.solr.core.SolrResourceLoader.java

License:Apache License

/**
 * Tell all {@link ResourceLoaderAware} instances about the loader
 *//*from w w  w .  j a  v  a 2s  . c o m*/
public void inform(ResourceLoader loader) throws IOException {

    // make a copy to avoid potential deadlock of a callback adding to the list
    ResourceLoaderAware[] arr;

    while (waitingForResources.size() > 0) {
        synchronized (waitingForResources) {
            arr = waitingForResources.toArray(new ResourceLoaderAware[waitingForResources.size()]);
            waitingForResources.clear();
        }

        for (ResourceLoaderAware aware : arr) {
            aware.inform(loader);
        }
    }
}