comparison OrthancServer/ServerContext.h @ 2673:8e0bc055d18c jobs

JobsRegistry::IObserver
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 11 Jun 2018 16:29:33 +0200
parents 3efc44fac209
children 3a55b77339ff
comparison
equal deleted inserted replaced
2672:3efc44fac209 2673:8e0bc055d18c
58 /** 58 /**
59 * This class is responsible for maintaining the storage area on the 59 * This class is responsible for maintaining the storage area on the
60 * filesystem (including compression), as well as the index of the 60 * filesystem (including compression), as well as the index of the
61 * DICOM store. It implements the required locking mechanisms. 61 * DICOM store. It implements the required locking mechanisms.
62 **/ 62 **/
63 class ServerContext 63 class ServerContext : private JobsRegistry::IObserver
64 { 64 {
65 private: 65 private:
66 class DicomCacheProvider : public ICachePageProvider 66 class DicomCacheProvider : public ICachePageProvider
67 { 67 {
68 private: 68 private:
115 115
116 void SetupJobsEngine(bool unitTesting, 116 void SetupJobsEngine(bool unitTesting,
117 bool loadJobsFromDatabase); 117 bool loadJobsFromDatabase);
118 118
119 void SaveJobsEngine(); 119 void SaveJobsEngine();
120
121 virtual void SignalJobSubmitted(const std::string& jobId);
122
123 virtual void SignalJobSuccess(const std::string& jobId);
124
125 virtual void SignalJobFailure(const std::string& jobId);
120 126
121 ServerIndex index_; 127 ServerIndex index_;
122 IStorageArea& area_; 128 IStorageArea& area_;
123 129
124 bool compressionEnabled_; 130 bool compressionEnabled_;
137 143
138 ServerListeners listeners_; 144 ServerListeners listeners_;
139 boost::recursive_mutex listenersMutex_; 145 boost::recursive_mutex listenersMutex_;
140 146
141 bool done_; 147 bool done_;
148 bool haveJobsChanged_;
142 SharedMessageQueue pendingChanges_; 149 SharedMessageQueue pendingChanges_;
143 boost::thread changeThread_; 150 boost::thread changeThread_;
144 boost::thread saveJobsThread_; 151 boost::thread saveJobsThread_;
145 152
146 SharedArchive queryRetrieveArchive_; 153 SharedArchive queryRetrieveArchive_;