use of org.apache.uima.util.JCasPool in project lucene-solr by apache.
the class UIMAUpdateRequestProcessorFactory method getInstance.
@Override
public UpdateRequestProcessor getInstance(SolrQueryRequest req, SolrQueryResponse rsp, UpdateRequestProcessor next) {
SolrUIMAConfiguration configuration = new SolrUIMAConfigurationReader(args).readSolrUIMAConfiguration();
synchronized (this) {
if (ae == null && pool == null) {
AEProvider aeProvider = AEProviderFactory.getInstance().getAEProvider(req.getCore().getName(), configuration.getAePath(), configuration.getRuntimeParameters());
try {
ae = aeProvider.getAE();
pool = new JCasPool(10, ae);
} catch (ResourceInitializationException e) {
throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, e);
}
}
}
return new UIMAUpdateRequestProcessor(next, req.getCore().getName(), configuration, ae, pool);
}
Aggregations