aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonmv <venstad@gmail.com>2023-12-01 14:50:16 +0100
committerjonmv <venstad@gmail.com>2023-12-01 14:50:16 +0100
commitecc31f66643db54fce66d50517d9a14c4fa70b8c (patch)
tree401c1e548c8c426b43544d826171451ad906fcf3
parent831f2b6f993591fe94f5437792f4be0ee2fd185e (diff)
-rw-r--r--container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java b/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java
new file mode 100644
index 00000000000..2a5e2a371d2
--- /dev/null
+++ b/container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java
@@ -0,0 +1,27 @@
+package com.yahoo.container.jdisc.messagebus;
+
+import com.yahoo.component.AbstractComponent;
+import com.yahoo.component.annotation.Inject;
+import com.yahoo.document.DocumentTypeManager;
+import com.yahoo.documentapi.messagebus.protocol.DocumentProtocol;
+import com.yahoo.messagebus.ConfigAgent;
+import com.yahoo.messagebus.MessagebusConfig;
+
+/**
+ * This Exists only to update a session cache with the latest and greatest config, across container generations.
+ * <p>
+ * There is currently no way to force that this precedes other users of the SessionCache, without also forcing their
+ * recreation when this is recreated, which is, again, the whole point of this component.
+ * If we end up using an incomplete SessionCache, there will be trouble. We would need an additional mechanism in
+ * the graph setup framework to solve this problem – something like {@code @Before/@After/@ImmediatelyAfter}.
+ *
+ * @author jonmv
+ */
+public class MbusConfigurator extends AbstractComponent {
+
+ @Inject
+ public MbusConfigurator(SessionCache cache, DocumentTypeManager manager, MessagebusConfig messagebusConfig) {
+ cache.configure(new DocumentProtocol(manager), messagebusConfig);
+ }
+
+}