summaryrefslogtreecommitdiffstats
path: root/messagebus/src/main/java/com/yahoo/messagebus/ConfigHandler.java
blob: 6e16b593b5eb6f5cd61fb9c6a2dcf5c9ac4ad8b6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.messagebus;

import com.yahoo.messagebus.routing.RoutingSpec;

/**
 * This class declares those methods required to be a handler for an instance of the {@link ConfigAgent} class.
 * Instead of declaring separate subscribers and handlers for all types of configurations, this pair is intended to hold
 * everything. Extend this handler whenever new configs are added to {@link ConfigAgent}.
 *
 * @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
 */
public interface ConfigHandler {

    /**
     * Sets the routing specification for this client. This will be done synchronously during initialization, and then
     * subsequently whenever an updated configuration is available.
     *
     * @param spec The routing specification.
     */
    public void setupRouting(RoutingSpec spec);
}