only add a close hook for the httpshardhandlerfactory if *we* created it

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294723 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-02-28 16:35:05 +00:00
parent 436ba5ff34
commit 6f40a126e6
1 changed files with 10 additions and 9 deletions

View File

@ -142,16 +142,17 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware ,
shardHandlerFactory = core.getCoreDescriptor().getCoreContainer().getShardHandlerFactory();
} else {
shardHandlerFactory = core.createInitInstance(shfInfo, ShardHandlerFactory.class, null, null);
core.addCloseHook(new CloseHook() {
@Override
public void preClose(SolrCore core) {
shardHandlerFactory.close();
}
@Override
public void postClose(SolrCore core) {
}
});
}
core.addCloseHook(new CloseHook() {
@Override
public void preClose(SolrCore core) {
shardHandlerFactory.close();
}
@Override
public void postClose(SolrCore core) {
}
});
}
public List<SearchComponent> getComponents() {