summaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/container/Server.java
blob: a4dec6de5a2d9c73c4c8b55aeebf2ec0f42fcbfe (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
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container;

import com.yahoo.config.subscription.ConfigSubscriber;
import com.yahoo.container.QrConfig.Rpc;

/**
 * The http server singleton managing listeners for various ports,
 * and the threads used to respond to requests on the ports
 *
 * @author bratseth
 * @deprecated
 */
@SuppressWarnings("deprecation")
@Deprecated // TODO: Remove this when the last usage og getServerDiscriminator is removed
public class Server {

    //TODO: Make this final again.
    private static final Server instance = new Server();

    /** A short string which is different for all the qrserver instances on a given node. */
    private String localServerDiscriminator = "qrserver.0";

    private Server() { }

    public static Server get() {
        return instance;
    }

    public void initialize(QrConfig config) {
        localServerDiscriminator = config.discriminator();
    }

    /**
     * A string unique for this QRS on this server.
     *
     * @return a server specific string
     * @deprecated do not use
     */
    @Deprecated
    public String getServerDiscriminator() {
        return localServerDiscriminator;
    }

}