diff options
author | gjoranv <gv@verizonmedia.com> | 2022-07-09 23:43:40 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-07-11 23:10:20 +0200 |
commit | 2bbe2cd9c5276dde600961313ada24d2fa98b996 (patch) | |
tree | b558a0ff5ff80985c3a9ace6e6fc475d3f2119a4 /config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java | |
parent | 6b93d9971bc2594fb2766b845ac3e9362b32e60f (diff) |
Simplify by removing the not-so-useful generic param for Handler
- Uust declare it as a Component with other Components as children.
Diffstat (limited to 'config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java')
-rwxr-xr-x | config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java index a3cc2adf1c9..0632eef851f 100755 --- a/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/container/ContainerCluster.java @@ -221,14 +221,14 @@ public abstract class ContainerCluster<CONTAINER extends Container> } public void addMetricStateHandler() { - Handler<AbstractConfigProducer<?>> stateHandler = new Handler<>( + Handler stateHandler = new Handler( new ComponentModel(STATE_HANDLER_CLASS, null, null, null)); stateHandler.addServerBindings(STATE_HANDLER_BINDING_1, STATE_HANDLER_BINDING_2); addComponent(stateHandler); } public void addDefaultRootHandler() { - Handler<AbstractConfigProducer<?>> handler = new Handler<>( + Handler handler = new Handler( new ComponentModel(BundleInstantiationSpecification.getFromStrings( BINDINGS_OVERVIEW_HANDLER_CLASS, null, null), null)); // null bundle, as the handler is in container-disc handler.addServerBindings(ROOT_HANDLER_BINDING); @@ -236,7 +236,7 @@ public abstract class ContainerCluster<CONTAINER extends Container> } public void addApplicationStatusHandler() { - Handler<AbstractConfigProducer<?>> statusHandler = new Handler<>( + Handler statusHandler = new Handler( new ComponentModel(BundleInstantiationSpecification.getFromStrings( APPLICATION_STATUS_HANDLER_CLASS, null, null), null)); // null bundle, as the handler is in container-disc statusHandler.addServerBindings(SystemBindingPattern.fromHttpPath("/ApplicationStatus")); @@ -244,19 +244,19 @@ public abstract class ContainerCluster<CONTAINER extends Container> } public void addVipHandler() { - Handler<?> vipHandler = Handler.fromClassName(FileStatusHandlerComponent.CLASS); + Handler vipHandler = Handler.fromClassName(FileStatusHandlerComponent.CLASS); vipHandler.addServerBindings(VIP_HANDLER_BINDING); addComponent(vipHandler); } public final void addComponent(Component<?, ?> component) { componentGroup.addComponent(component); - if (component instanceof Handler<?> handler) { + if (component instanceof Handler handler) { ensureHandlerHasThreadpool(handler); } } - private void ensureHandlerHasThreadpool(Handler<?> handler) { + private void ensureHandlerHasThreadpool(Handler handler) { if (! handler.hasCustomThreadPool) { handler.inject(defaultHandlerThreadpool); } @@ -378,9 +378,8 @@ public abstract class ContainerCluster<CONTAINER extends Container> return containerDocproc.getChains(); } - @SuppressWarnings("unchecked") - public Collection<Handler<?>> getHandlers() { - return (Collection<Handler<?>>)(Collection)componentGroup.getComponents(Handler.class); + public Collection<Handler> getHandlers() { + return componentGroup.getComponents(Handler.class); } public void setSecretStore(SecretStore secretStore) { |