Line data Source code
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 : : server_(server), validation_visitor_(validation_visitor), scope_(std::move(scope)), 11 378 : listener_scope_(std::move(listener_scope)), listener_info_(listener_info) { 12 378 : ASSERT(listener_info_ != nullptr); 13 378 : } 14 : 15 4694 : Configuration::ServerFactoryContext& FactoryContextImplBase::serverFactoryContext() const { 16 4694 : return server_.serverFactoryContext(); 17 4694 : } 18 : 19 1729 : ProtobufMessage::ValidationVisitor& FactoryContextImplBase::messageValidationVisitor() const { 20 1729 : return validation_visitor_; 21 1729 : } 22 : 23 146 : Stats::Scope& FactoryContextImplBase::scope() { return *scope_; } 24 : 25 : Configuration::TransportSocketFactoryContext& 26 0 : FactoryContextImplBase::getTransportSocketFactoryContext() const { 27 0 : return server_.transportSocketFactoryContext(); 28 0 : } 29 : 30 2438 : Stats::Scope& FactoryContextImplBase::listenerScope() { return *listener_scope_; } 31 : 32 136 : const Network::ListenerInfo& FactoryContextImplBase::listenerInfo() const { 33 136 : return *listener_info_; 34 136 : } 35 : 36 : FactoryContextImpl::FactoryContextImpl(Server::Instance& server, 37 : Network::DrainDecision& drain_decision, 38 : Stats::ScopeSharedPtr scope, 39 : Stats::ScopeSharedPtr listener_scope, 40 : const Network::ListenerInfoConstSharedPtr& listener_info) 41 : : FactoryContextImplBase(server, server.messageValidationContext().staticValidationVisitor(), 42 : std::move(scope), std::move(listener_scope), listener_info), 43 0 : drain_decision_(drain_decision) {} 44 : 45 0 : Init::Manager& FactoryContextImpl::initManager() { return server_.initManager(); } 46 : 47 0 : Network::DrainDecision& FactoryContextImpl::drainDecision() { return drain_decision_; } 48 : 49 : } // namespace Server 50 : } // namespace Envoy