Example usage for org.apache.solr.util.plugin SolrCoreAware inform

List of usage examples for org.apache.solr.util.plugin SolrCoreAware inform

Introduction

In this page you can find the example usage for org.apache.solr.util.plugin SolrCoreAware inform.

Prototype

void inform(SolrCore core);

Source Link

Usage

From source file:org.liveSense.service.solr.api.OverridedSolrResourceLoader.java

License:Apache License

/**
 * Tell all {@link SolrCoreAware} instances about the SolrCore
 */// ww  w  .  ja  v  a 2  s  .  c o m
public void inform(SolrCore core) {
    this.dataDir = core.getDataDir();

    // make a copy to avoid potential deadlock of a callback calling newInstance and trying to
    // add something to waitingForCore.
    SolrCoreAware[] arr;

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

        for (SolrCoreAware aware : arr) {
            aware.inform(core);
        }
    }

    // this is the last method to be called in SolrCore before the latch is released.
    live = true;
}