aboutsummaryrefslogtreecommitdiffstats
path: root/messagebus/src/vespa/messagebus/configagent.h
blob: 59f4fc4f1dda110f817bf6f063afe3d75915127c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/messagebus/common.h>
#include <vespa/config/helper/configfetcher.h>
#include <vespa/messagebus/config-messagebus.h>

namespace mbus {

class IConfigHandler;

/**
 * A ConfigAgent will register with the config server and obtain
 * config on behalf of a IConfigHandler.
 **/
class ConfigAgent : public config::IFetcherCallback<messagebus::MessagebusConfig>
{
private:
    IConfigHandler &_handler;

public:
    ConfigAgent(const ConfigAgent &) = delete;
    ConfigAgent & operator = (const ConfigAgent &) = delete;
    ConfigAgent(IConfigHandler & handler);

    // Implements IFetcherCallback
    void configure(std::unique_ptr<messagebus::MessagebusConfig> config) override;
};

} // namespace mbus