diff options
author | Arne Juul <arnej@yahoo-inc.com> | 2018-01-05 12:25:19 +0000 |
---|---|---|
committer | Arne Juul <arnej@yahoo-inc.com> | 2018-01-05 12:25:19 +0000 |
commit | 2d4680b800d12308fde55235c51c11a7421006a0 (patch) | |
tree | d341ee7ea557d4e1d5914c0323dafcf5c89a830c /clustercontroller-apps/src/main | |
parent | d13d3171cd3faceb129642d26b2dc5466438514e (diff) |
use LoggingRequestHandler.Context in constructors
* this implicitly wires in a Metric, allowing handler invocations
to be measured in the ThreadedRequestHandler superclass.
Diffstat (limited to 'clustercontroller-apps/src/main')
2 files changed, 14 insertions, 13 deletions
diff --git a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2Handler.java b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2Handler.java index eea085bd103..7f0acd83b0d 100644 --- a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2Handler.java +++ b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StateRestApiV2Handler.java @@ -3,7 +3,6 @@ package com.yahoo.vespa.clustercontroller.apps.clustercontroller; import com.google.inject.Inject; import com.yahoo.cloud.config.ClusterInfoConfig; -import com.yahoo.container.logging.AccessLog; import com.yahoo.log.LogLevel; import com.yahoo.vespa.clustercontroller.apputil.communication.http.JDiscHttpRequestHandler; import com.yahoo.vespa.clustercontroller.core.restapiv2.ClusterControllerStateRestAPI; @@ -13,19 +12,22 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import java.util.TreeMap; -import java.util.concurrent.Executor; import java.util.logging.Logger; public class StateRestApiV2Handler extends JDiscHttpRequestHandler { private static final Logger log = Logger.getLogger(StateRestApiV2Handler.class.getName()); @Inject - public StateRestApiV2Handler(Executor executor, ClusterController cc, ClusterInfoConfig config, AccessLog accessLog) { - this(executor, new ClusterControllerStateRestAPI(cc, getClusterControllerSockets(config)), "/cluster/v2", accessLog); + public StateRestApiV2Handler(ClusterController cc, ClusterInfoConfig config, + JDiscHttpRequestHandler.Context ctx) + { + this(new ClusterControllerStateRestAPI(cc, getClusterControllerSockets(config)), "/cluster/v2", ctx); } - private StateRestApiV2Handler(Executor executor, ClusterControllerStateRestAPI restApi, String pathPrefix, AccessLog accessLog) { - super(new RestApiHandler(restApi).setDefaultPathPrefix(pathPrefix), executor, accessLog); + private StateRestApiV2Handler(ClusterControllerStateRestAPI restApi, String pathPrefix, + JDiscHttpRequestHandler.Context ctx) + { + super(new RestApiHandler(restApi).setDefaultPathPrefix(pathPrefix), ctx); } // This method is package-private instead of private to be accessible to unit-tests. diff --git a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandler.java b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandler.java index ae7c32e0f95..6817a033675 100644 --- a/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandler.java +++ b/clustercontroller-apps/src/main/java/com/yahoo/vespa/clustercontroller/apps/clustercontroller/StatusHandler.java @@ -2,22 +2,21 @@ package com.yahoo.vespa.clustercontroller.apps.clustercontroller; import com.google.inject.Inject; -import com.yahoo.container.logging.AccessLog; import com.yahoo.vespa.clustercontroller.apputil.communication.http.JDiscHttpRequestHandler; -import java.util.concurrent.Executor; - public class StatusHandler extends JDiscHttpRequestHandler { private final com.yahoo.vespa.clustercontroller.core.status.StatusHandler statusHandler; @Inject - public StatusHandler(ClusterController fc, Executor executor, AccessLog accessLog) { - this(new com.yahoo.vespa.clustercontroller.core.status.StatusHandler(fc), executor, accessLog); + public StatusHandler(ClusterController fc, JDiscHttpRequestHandler.Context ctx) { + this(new com.yahoo.vespa.clustercontroller.core.status.StatusHandler(fc), ctx); } - private StatusHandler(com.yahoo.vespa.clustercontroller.core.status.StatusHandler handler, Executor executor, AccessLog accessLog) { - super(handler, executor, accessLog); + private StatusHandler(com.yahoo.vespa.clustercontroller.core.status.StatusHandler handler, + JDiscHttpRequestHandler.Context ctx) + { + super(handler, ctx); this.statusHandler = handler; } |