blob: e8a841a8c1b1a4b9162f78aa0bd1a889f306a91a (
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
|
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.service;
import com.google.inject.Inject;
import com.yahoo.jdisc.AbstractResource;
import com.yahoo.jdisc.Request;
import java.util.Objects;
/**
* <p>This is a convenient parent class for {@link ServerProvider} with default implementations for all but the
* essential {@link #start()} and {@link #close()} methods. It requires that the {@link CurrentContainer} is injected in
* the constructor, since that interface is needed to dispatch {@link Request}s.</p>
*
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public abstract class AbstractServerProvider extends AbstractResource implements ServerProvider {
private final CurrentContainer container;
@Inject
protected AbstractServerProvider(CurrentContainer container) {
Objects.requireNonNull(container, "container");
this.container = container;
}
public final CurrentContainer container() {
return container;
}
}
|