diff options
Diffstat (limited to 'container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java')
-rw-r--r-- | container-messagebus/src/main/java/com/yahoo/container/jdisc/messagebus/MbusConfigurator.java | 27 |
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); + } + +} |