1
#include "source/server/factory_context_impl.h"
2

            
3
namespace Envoy {
4
namespace Server {
5

            
6
FactoryContextImplBase::FactoryContextImplBase(
7
    Server::Instance& server, ProtobufMessage::ValidationVisitor& validation_visitor,
8
    Stats::ScopeSharedPtr scope, Stats::ScopeSharedPtr listener_scope,
9
    const Network::ListenerInfoConstSharedPtr& listener_info)
10
22609
    : server_(server), validation_visitor_(validation_visitor), scope_(std::move(scope)),
11
22609
      listener_scope_(std::move(listener_scope)), listener_info_(listener_info) {
12
22609
  ASSERT(listener_info_ != nullptr);
13
22609
}
14

            
15
345785
Configuration::ServerFactoryContext& FactoryContextImplBase::serverFactoryContext() {
16
345785
  return server_.serverFactoryContext();
17
345785
}
18

            
19
157873
ProtobufMessage::ValidationVisitor& FactoryContextImplBase::messageValidationVisitor() {
20
157873
  return validation_visitor_;
21
157873
}
22

            
23
12044
Stats::Scope& FactoryContextImplBase::scope() { return *scope_; }
24

            
25
252061
Stats::Scope& FactoryContextImplBase::listenerScope() { return *listener_scope_; }
26

            
27
53418
const Network::ListenerInfo& FactoryContextImplBase::listenerInfo() const {
28
53418
  return *listener_info_;
29
53418
}
30

            
31
FactoryContextImpl::FactoryContextImpl(Server::Instance& server,
32
                                       Network::DrainDecision& drain_decision,
33
                                       Stats::ScopeSharedPtr scope,
34
                                       Stats::ScopeSharedPtr listener_scope,
35
                                       const Network::ListenerInfoConstSharedPtr& listener_info)
36
16
    : FactoryContextImplBase(server, server.messageValidationContext().staticValidationVisitor(),
37
16
                             std::move(scope), std::move(listener_scope), listener_info),
38
16
      drain_decision_(drain_decision) {}
39

            
40
Init::Manager& FactoryContextImpl::initManager() { return server_.initManager(); }
41

            
42
11
Network::DrainDecision& FactoryContextImpl::drainDecision() { return drain_decision_; }
43

            
44
} // namespace Server
45
} // namespace Envoy