Add extra ctor to FilterClient to support Guice proxies

just don't ask it's bad but some plugins are so involved they need this.

Closes #the_issue_that_never_existed
This commit is contained in:
Simon Willnauer 2016-06-20 16:46:03 +02:00
parent 0660de7472
commit 9196ff255e
1 changed files with 11 additions and 1 deletions

View File

@ -24,6 +24,8 @@ import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestBuilder;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.client.support.AbstractClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.threadpool.ThreadPool;
/**
@ -42,7 +44,15 @@ public abstract class FilterClient extends AbstractClient {
* @see #in()
*/
public FilterClient(Client in) {
super(in.settings(), in.threadPool());
this(in.settings(), in.threadPool(), in);
}
/**
* A Constructor that allows to pass settings and threadpool separately. This is useful if the
* client is a proxy and not yet fully constructed ie. both dependencies are not available yet.
*/
protected FilterClient(Settings settings, ThreadPool threadPool, Client in) {
super(settings, threadPool);
this.in = in;
}