forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfactory_context_impl.h
55 lines (44 loc) · 1.94 KB
/
factory_context_impl.h
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include "envoy/server/factory_context.h"
#include "envoy/server/instance.h"
#include "source/common/config/metadata.h"
namespace Envoy {
namespace Server {
class FactoryContextImplBase : virtual public Configuration::FactoryContext {
public:
FactoryContextImplBase(Server::Instance& server,
ProtobufMessage::ValidationVisitor& validation_visitor,
Stats::ScopeSharedPtr scope, Stats::ScopeSharedPtr listener_scope,
const Network::ListenerInfoConstSharedPtr& listener_info);
// Configuration::FactoryContext
Configuration::ServerFactoryContext& serverFactoryContext() const override;
Stats::Scope& scope() override;
ProtobufMessage::ValidationVisitor& messageValidationVisitor() const override;
Configuration::TransportSocketFactoryContext& getTransportSocketFactoryContext() const override;
const Network::ListenerInfo& listenerInfo() const override;
Stats::Scope& listenerScope() override;
protected:
Server::Instance& server_;
ProtobufMessage::ValidationVisitor& validation_visitor_;
// Listener scope without the listener prefix.
Stats::ScopeSharedPtr scope_;
// Listener scope with the listener prefix.
Stats::ScopeSharedPtr listener_scope_;
const Network::ListenerInfoConstSharedPtr listener_info_;
};
/**
* Implementation of FactoryContext wrapping a Server::Instance and some listener components.
*/
class FactoryContextImpl : public FactoryContextImplBase {
public:
FactoryContextImpl(Server::Instance& server, Network::DrainDecision& drain_decision,
Stats::ScopeSharedPtr scope, Stats::ScopeSharedPtr listener_scope,
const Network::ListenerInfoConstSharedPtr& listener_info);
// Configuration::FactoryContext
Init::Manager& initManager() override;
Network::DrainDecision& drainDecision() override;
private:
Network::DrainDecision& drain_decision_;
};
} // namespace Server
} // namespace Envoy