aboutsummaryrefslogtreecommitdiffstats
path: root/container-disc/src/main/java/com/yahoo/container/jdisc/ContainerThreadFactory.java
blob: b087c4e80b3ac7258d054db7635de8b11e9741a3 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.container.jdisc;

import com.yahoo.container.jdisc.metric.MetricConsumerProvider;
import com.yahoo.jdisc.application.ContainerThread;

import java.util.concurrent.ThreadFactory;

/**
 * @author Simon Thoresen Hult
 */
public class ContainerThreadFactory implements ThreadFactory {

    private final ThreadFactory delegate;

    public ContainerThreadFactory(MetricConsumerProvider metricConsumerProvider) {
        delegate = new ContainerThread.Factory(metricConsumerProvider::newInstance);
    }

    @Override
    public Thread newThread(Runnable target) {
        return delegate.newThread(target);
    }

}