@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); }
private void initialize(SolrCore solrCore, SolrUIMAConfiguration config) { this.solrCore = solrCore; solrUIMAConfiguration = config; try { desc = SentenceAnnotator.getDescription(); } catch (ResourceInitializationException e) { throw new RuntimeException(e); } aeProvider = new AEProvider() { @Override public AnalysisEngine getAE() throws ResourceInitializationException { return createPrimitive(desc); } }; }