Mercurial > hg > orthanc-stone
comparison Platforms/Generic/OracleWebService.h @ 271:46c5296d867e am-2
OracleWebService and BasicSdlApplicationContext using the same global mutex
author | am@osimis.io |
---|---|
date | Thu, 23 Aug 2018 17:12:54 +0200 |
parents | 9afafb192180 |
children | dc1beee33134 |
comparison
equal
deleted
inserted
replaced
270:2d64f4d39610 | 271:46c5296d867e |
---|---|
23 | 23 |
24 #include "../../Framework/Toolbox/IWebService.h" | 24 #include "../../Framework/Toolbox/IWebService.h" |
25 #include "Oracle.h" | 25 #include "Oracle.h" |
26 #include "WebServiceGetCommand.h" | 26 #include "WebServiceGetCommand.h" |
27 #include "WebServicePostCommand.h" | 27 #include "WebServicePostCommand.h" |
28 #include "../../Applications/Sdl/BasicSdlApplicationContext.h" | |
28 | 29 |
29 namespace OrthancStone | 30 namespace OrthancStone |
30 { | 31 { |
31 class OracleWebService : public IWebService | 32 class OracleWebService : public IWebService |
32 { | 33 { |
33 private: | 34 private: |
34 Oracle& oracle_; | 35 Oracle& oracle_; |
36 BasicSdlApplicationContext& context_; | |
35 Orthanc::WebServiceParameters parameters_; | 37 Orthanc::WebServiceParameters parameters_; |
36 | 38 |
37 public: | 39 public: |
38 OracleWebService(MessageBroker& broker, | 40 OracleWebService(MessageBroker& broker, |
39 Oracle& oracle, | 41 Oracle& oracle, |
40 const Orthanc::WebServiceParameters& parameters) : | 42 const Orthanc::WebServiceParameters& parameters, |
43 BasicSdlApplicationContext& context) : | |
41 IWebService(broker), | 44 IWebService(broker), |
42 oracle_(oracle), | 45 oracle_(oracle), |
46 context_(context), | |
43 parameters_(parameters) | 47 parameters_(parameters) |
44 { | 48 { |
45 } | 49 } |
46 | 50 |
47 virtual void ScheduleGetRequest(ICallback& callback, | 51 virtual void ScheduleGetRequest(ICallback& callback, |
48 const std::string& uri, | 52 const std::string& uri, |
49 const Headers& headers, | 53 const Headers& headers, |
50 Orthanc::IDynamicObject* payload) | 54 Orthanc::IDynamicObject* payload) |
51 { | 55 { |
52 oracle_.Submit(new WebServiceGetCommand(broker_, callback, parameters_, uri, headers, payload)); | 56 oracle_.Submit(new WebServiceGetCommand(broker_, callback, parameters_, uri, headers, payload, context_)); |
53 } | 57 } |
54 | 58 |
55 virtual void SchedulePostRequest(ICallback& callback, | 59 virtual void SchedulePostRequest(ICallback& callback, |
56 const std::string& uri, | 60 const std::string& uri, |
57 const Headers& headers, | 61 const Headers& headers, |
58 const std::string& body, | 62 const std::string& body, |
59 Orthanc::IDynamicObject* payload) | 63 Orthanc::IDynamicObject* payload) |
60 { | 64 { |
61 oracle_.Submit(new WebServicePostCommand(broker_, callback, parameters_, uri, headers, body, payload)); | 65 oracle_.Submit(new WebServicePostCommand(broker_, callback, parameters_, uri, headers, body, payload, context_)); |
62 } | 66 } |
63 | 67 |
64 void Start() | 68 void Start() |
65 { | 69 { |
66 oracle_.Start(); | 70 oracle_.Start(); |