aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--container-core/src/main/java/com/yahoo/restapi/RestApiRequestHandler.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/container-core/src/main/java/com/yahoo/restapi/RestApiRequestHandler.java b/container-core/src/main/java/com/yahoo/restapi/RestApiRequestHandler.java
index 5640bbc5445..c501ad8c804 100644
--- a/container-core/src/main/java/com/yahoo/restapi/RestApiRequestHandler.java
+++ b/container-core/src/main/java/com/yahoo/restapi/RestApiRequestHandler.java
@@ -4,6 +4,9 @@ package com.yahoo.restapi;
import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;
+import com.yahoo.jdisc.Metric;
+
+import java.util.concurrent.Executor;
/**
* @author bjorncs
@@ -25,11 +28,25 @@ public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>>
this.restApi = provider.createRestApi((T)this);
}
+ /**
+ * @see #RestApiRequestHandler(Context, RestApiProvider)
+ */
+ @SuppressWarnings("unchecked")
+ protected RestApiRequestHandler(Executor executor, Metric metric, RestApiProvider<T> provider) {
+ super(executor, metric);
+ this.restApi = provider.createRestApi((T)this);
+ }
+
protected RestApiRequestHandler(LoggingRequestHandler.Context context, RestApi restApi) {
super(context);
this.restApi = restApi;
}
+ protected RestApiRequestHandler(Executor executor, Metric metric, RestApi restApi) {
+ super(executor, metric);
+ this.restApi = restApi;
+ }
+
@Override public final HttpResponse handle(HttpRequest request) { return restApi.handleRequest(request); }
public RestApi restApi() { return restApi; }