diff options
Diffstat (limited to 'src/mongo/db/service_context.h')
-rw-r--r-- | src/mongo/db/service_context.h | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/mongo/db/service_context.h b/src/mongo/db/service_context.h index fe6a4432d70..174a52ebe52 100644 --- a/src/mongo/db/service_context.h +++ b/src/mongo/db/service_context.h @@ -48,6 +48,12 @@ class Client; class OperationContext; class OpObserver; +namespace transport { +class Session; +class TransportLayer; +class TransportLayerManager; +} // namespace transport + /** * Classes that implement this interface can receive notification on killOp. * @@ -207,9 +213,9 @@ public: * * The "desc" string is used to set a descriptive name for the client, used in logging. * - * If supplied, "p" is the communication channel used for communicating with the client. + * If supplied, "session" is the transport::Session used for communicating with the client. */ - UniqueClient makeClient(std::string desc, AbstractMessagingPort* p = nullptr); + UniqueClient makeClient(std::string desc, transport::Session* session = nullptr); /** * Creates a new OperationContext on "client". @@ -299,6 +305,26 @@ public: void registerKillOpListener(KillOpListenerInterface* listener); // + // Transport. + // + + /** + * Get the master TransportLayer. Routes to all other TransportLayers that + * may be in use within this service. + * + * See TransportLayerManager for more details. + */ + transport::TransportLayer* getTransportLayer() const; + + /** + * Add a new TransportLayer to this service context. The new TransportLayer will + * be added to the TransportLayerManager accessible via getTransportLayer(). + * + * It additionally calls start() on the TransportLayer after adding it. + */ + Status addAndStartTransportLayer(std::unique_ptr<transport::TransportLayer> tl); + + // // Global OpObserver. // @@ -370,6 +396,11 @@ private: /** + * The TransportLayerManager. + */ + std::unique_ptr<transport::TransportLayerManager> _transportLayerManager; + + /** * Vector of registered observers. */ std::vector<std::unique_ptr<ClientObserver>> _clientObservers; |