aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/jdisc/http/server/jetty/JDiscContext.java
blob: b37a7352dc674fcfc2c7e86f494d17b7c8c0f647 (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
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.http.server.jetty;

import com.yahoo.jdisc.Metric;
import com.yahoo.jdisc.http.ServerConfig;
import com.yahoo.jdisc.service.CurrentContainer;

import java.util.concurrent.Executor;

public class JDiscContext {
    final FilterResolver filterResolver;
    final CurrentContainer container;
    final Executor janitor;
    final Metric metric;
    final ServerConfig serverConfig;

    public JDiscContext(FilterBindings filterBindings,
                        CurrentContainer container,
                        Executor janitor,
                        Metric metric,
                        ServerConfig serverConfig) {

        this.filterResolver = new FilterResolver(filterBindings, metric, serverConfig.strictFiltering());
        this.container = container;
        this.janitor = janitor;
        this.metric = metric;
        this.serverConfig = serverConfig;
    }

    public boolean developerMode() {
        return serverConfig.developerMode();
    }
}