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
22581
    : server_(server), validation_visitor_(validation_visitor), scope_(std::move(scope)),
11
22581
      listener_scope_(std::move(listener_scope)), listener_info_(listener_info) {
12
22581
  ASSERT(listener_info_ != nullptr);
13
22581
}
14

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

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

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

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

            
27
53472
const Network::ListenerInfo& FactoryContextImplBase::listenerInfo() const {
28
53472
  return *listener_info_;
29
53472
}
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