changeset 1128:8e3763d1736a broker

removing CustomOracleCommand
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 05 Nov 2019 22:39:25 +0100
parents 3308ef083297
children c3d4adf8bc70
files Framework/Loaders/DicomStructureSetLoader.cpp Framework/Loaders/LoaderStateMachine.cpp Framework/Loaders/LoaderStateMachine.h Framework/Loaders/OrthancMultiframeVolumeLoader.cpp Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp Framework/Oracle/CustomOracleCommand.h Framework/Oracle/GenericOracleRunner.cpp Framework/Oracle/GetOrthancImageCommand.h Framework/Oracle/GetOrthancWebViewerJpegCommand.h Framework/Oracle/HttpCommand.h Framework/Oracle/IOracleCommand.h Framework/Oracle/OracleCommandBase.cpp Framework/Oracle/OracleCommandBase.h Framework/Oracle/OracleCommandExceptionMessage.h Framework/Oracle/OracleCommandWithPayload.cpp Framework/Oracle/OracleCommandWithPayload.h Framework/Oracle/OrthancRestApiCommand.h Framework/Oracle/ParseDicomFileCommand.h Framework/Oracle/ReadFileCommand.h Framework/Oracle/SleepOracleCommand.h Framework/Oracle/ThreadedOracle.cpp Resources/CMake/OrthancStoneConfiguration.cmake
diffstat 22 files changed, 188 insertions(+), 207 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Loaders/DicomStructureSetLoader.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Loaders/DicomStructureSetLoader.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -144,7 +144,7 @@
         command->SetHttpHeader("Accept-Encoding", "gzip");
         std::string uri = "/instances/" + instanceId + "/tags";
         command->SetUri(uri);
-        command->SetPayload(new AddReferencedInstance(loader, instanceId));
+        command->AcquirePayload(new AddReferencedInstance(loader, instanceId));
         Schedule(command.release());
       }
     }
@@ -231,7 +231,7 @@
         command->SetUri("/tools/lookup");
         command->SetMethod(Orthanc::HttpMethod_Post);
         command->SetBody(*it);
-        command->SetPayload(new LookupInstance(loader, *it));
+        command->AcquirePayload(new LookupInstance(loader, *it));
         Schedule(command.release());
       }
     }
@@ -382,7 +382,7 @@
       std::string uri = "/instances/" + instanceId + "/tags?ignore-length=3006-0050";
 
       command->SetUri(uri);
-      command->SetPayload(new LoadStructure(*this));
+      command->AcquirePayload(new LoadStructure(*this));
       Schedule(command.release());
     }
   }
--- a/Framework/Loaders/LoaderStateMachine.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Loaders/LoaderStateMachine.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -43,11 +43,11 @@
   }
 
 
-  void LoaderStateMachine::Schedule(OracleCommandWithPayload* command)
+  void LoaderStateMachine::Schedule(OracleCommandBase* command)
   {
     LOG(TRACE) << "LoaderStateMachine(" << std::hex << this << std::dec << ")::Schedule()";
 
-    std::auto_ptr<OracleCommandWithPayload> protection(command);
+    std::auto_ptr<OracleCommandBase> protection(command);
 
     if (command == NULL)
     {
--- a/Framework/Loaders/LoaderStateMachine.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Loaders/LoaderStateMachine.h	Tue Nov 05 22:39:25 2019 +0100
@@ -60,7 +60,7 @@
       {
       }
 
-      void Schedule(OracleCommandWithPayload* command) const
+      void Schedule(OracleCommandBase* command) const
       {
         that_.Schedule(command);
       }
@@ -78,7 +78,7 @@
       virtual void Handle(const GetOrthancWebViewerJpegCommand::SuccessMessage& message);
     };
 
-    void Schedule(OracleCommandWithPayload* command);
+    void Schedule(OracleCommandBase* command);
 
     void Start();
 
--- a/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Loaders/OrthancMultiframeVolumeLoader.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -101,7 +101,7 @@
         std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
         command->SetUri("/instances/" + loader.GetInstanceId() + "/content/" +
                         Orthanc::DICOM_TAG_GRID_FRAME_OFFSET_VECTOR.Format());
-        command->SetPayload(new LoadRTDoseGeometry(loader, dicom.release()));
+        command->AcquirePayload(new LoadRTDoseGeometry(loader, dicom.release()));
 
         Schedule(command.release());
       }
@@ -175,7 +175,7 @@
       command->SetHttpHeader("Accept-Encoding", "gzip");
       command->SetUri("/instances/" + instanceId_ + "/content/" +
                       Orthanc::DICOM_TAG_PIXEL_DATA.Format() + "/0");
-      command->SetPayload(new LoadUncompressedPixelData(*this));
+      command->AcquirePayload(new LoadUncompressedPixelData(*this));
       Schedule(command.release());
     }
     else
@@ -369,14 +369,14 @@
       std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
       command->SetHttpHeader("Accept-Encoding", "gzip");
       command->SetUri("/instances/" + instanceId + "/tags");
-      command->SetPayload(new LoadGeometry(*this));
+      command->AcquirePayload(new LoadGeometry(*this));
       Schedule(command.release());
     }
 
     {
       std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
       command->SetUri("/instances/" + instanceId + "/metadata/TransferSyntax");
-      command->SetPayload(new LoadTransferSyntax(*this));
+      command->AcquirePayload(new LoadTransferSyntax(*this));
       Schedule(command.release());
     }
   }
--- a/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Loaders/OrthancSeriesVolumeProgressiveLoader.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -237,7 +237,7 @@
   }
 
 
-  static unsigned int GetSliceIndexPayload(const OracleCommandWithPayload& command)
+  static unsigned int GetSliceIndexPayload(const OracleCommandBase& command)
   {
     return dynamic_cast< const Orthanc::SingleValueObject<unsigned int>& >(command.GetPayload()).GetValue();
   }
@@ -261,7 +261,7 @@
         throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError);
       }
 
-      std::auto_ptr<OracleCommandWithPayload> command;
+      std::auto_ptr<OracleCommandBase> command;
         
       if (quality == BEST_QUALITY)
       {
@@ -291,7 +291,7 @@
         command.reset(tmp.release());
       }
 
-      command->SetPayload(new Orthanc::SingleValueObject<unsigned int>(sliceIndex));
+      command->AcquirePayload(new Orthanc::SingleValueObject<unsigned int>(sliceIndex));
 
       boost::shared_ptr<IObserver> observer(GetSharedObserver());
       oracle_.Schedule(observer, command.release());
--- a/Framework/Oracle/CustomOracleCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#pragma once
-
-#include "IOracleRunner.h"
-
-namespace OrthancStone
-{
-  class CustomOracleCommand : public IOracleCommand
-  {
-  public:
-    virtual Type GetType() const
-    {
-      return Type_Custom;
-    }
-
-    virtual IMessage* Execute(IOracleRunner& runner) = 0;
-  };
-}
--- a/Framework/Oracle/GenericOracleRunner.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/GenericOracleRunner.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -25,7 +25,6 @@
 #  error The macro ORTHANC_ENABLE_DCMTK must be defined
 #endif
 
-#include "CustomOracleCommand.h"
 #include "GetOrthancImageCommand.h"
 #include "GetOrthancWebViewerJpegCommand.h"
 #include "HttpCommand.h"
@@ -214,7 +213,7 @@
 
 
   static IMessage* Execute(const std::string& root,
-                           const ReadFileCommand& command)
+                           ReadFileCommand& command)
   {
     std::string path = GetPath(root, command.GetPath());
 
@@ -348,11 +347,8 @@
         case IOracleCommand::Type_GetOrthancWebViewerJpeg:
           return Execute(orthanc_, dynamic_cast<const GetOrthancWebViewerJpegCommand&>(command));
 
-        case IOracleCommand::Type_Custom:
-          return dynamic_cast<CustomOracleCommand&>(command).Execute(*this);
-
         case IOracleCommand::Type_ReadFile:
-          return Execute(rootDirectory_, dynamic_cast<const ReadFileCommand&>(command));
+          return Execute(rootDirectory_, dynamic_cast<ReadFileCommand&>(command));
 
         case IOracleCommand::Type_ParseDicomFile:
 #if ORTHANC_ENABLE_DCMTK == 1
--- a/Framework/Oracle/GetOrthancImageCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/GetOrthancImageCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,7 +22,7 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 #include <Core/Images/ImageAccessor.h>
 
@@ -30,7 +30,7 @@
 
 namespace OrthancStone
 {
-  class GetOrthancImageCommand : public OracleCommandWithPayload
+  class GetOrthancImageCommand : public OracleCommandBase
   {
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
--- a/Framework/Oracle/GetOrthancWebViewerJpegCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/GetOrthancWebViewerJpegCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,7 +22,7 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 #include <Core/Images/ImageAccessor.h>
 
@@ -30,7 +30,7 @@
 
 namespace OrthancStone
 {
-  class GetOrthancWebViewerJpegCommand : public OracleCommandWithPayload
+  class GetOrthancWebViewerJpegCommand : public OracleCommandBase
   {
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
--- a/Framework/Oracle/HttpCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/HttpCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,7 +22,7 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 #include <Core/Enumerations.h>
 
@@ -31,7 +31,7 @@
 
 namespace OrthancStone
 {
-  class HttpCommand : public OracleCommandWithPayload
+  class HttpCommand : public OracleCommandBase
   {
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
--- a/Framework/Oracle/IOracleCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/IOracleCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -21,6 +21,10 @@
 
 #pragma once
 
+#include "../Messages/IMessage.h"
+
+#include <Core/IDynamicObject.h>
+
 #include <boost/noncopyable.hpp>
 
 namespace OrthancStone
@@ -28,9 +32,30 @@
   class IOracleCommand : public boost::noncopyable
   {
   public:
+    class OracleMessageBase : public IMessage
+    {
+    private:
+      IOracleCommand&  command_;
+
+    public:
+      OracleMessageBase(IOracleCommand& command) :
+        command_(command)
+      {
+      }
+
+      void AcquireCommandPayload(Orthanc::IDynamicObject* payload) const
+      {
+        command_.AcquirePayload(payload);
+      }
+
+      const IOracleCommand& GetCommand() const
+      {
+        return command_;
+      }
+    };
+
     enum Type
     {
-      Type_Custom,
       Type_GetOrthancImage,
       Type_GetOrthancWebViewerJpeg,
       Type_Http,
@@ -45,5 +70,11 @@
     }
 
     virtual Type GetType() const = 0;
+
+    virtual void AcquirePayload(Orthanc::IDynamicObject* payload) = 0;
+    
+    virtual bool HasPayload() const = 0;
+
+    virtual Orthanc::IDynamicObject& GetPayload() const = 0;
   };
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Framework/Oracle/OracleCommandBase.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -0,0 +1,67 @@
+/**
+ * Stone of Orthanc
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Affero General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include "OracleCommandBase.h"
+
+#include <Core/OrthancException.h>
+
+namespace OrthancStone
+{
+  void OracleCommandBase::AcquirePayload(Orthanc::IDynamicObject* payload)
+  {
+    if (payload == NULL)
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
+    }
+    else
+    {
+      payload_.reset(payload);
+    }    
+  }
+
+
+  Orthanc::IDynamicObject& OracleCommandBase::GetPayload() const
+  {
+    if (HasPayload())
+    {
+      return *payload_;
+    }
+    else
+    {
+      LOG(ERROR) << "OracleCommandBase::GetPayload(): (!HasPayload())";
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+  }
+
+
+  Orthanc::IDynamicObject* OracleCommandBase::ReleasePayload()
+  {
+    if (HasPayload())
+    {
+      return payload_.release();
+    }
+    else
+    {
+      LOG(ERROR) << "OracleCommandBase::ReleasePayload(): (!HasPayload())";
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Framework/Oracle/OracleCommandBase.h	Tue Nov 05 22:39:25 2019 +0100
@@ -0,0 +1,47 @@
+/**
+ * Stone of Orthanc
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation, either version 3 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Affero General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#pragma once
+
+#include "IOracleCommand.h"
+
+#include <memory>
+
+namespace OrthancStone
+{
+  class OracleCommandBase : public IOracleCommand
+  {
+  private:
+    std::auto_ptr<Orthanc::IDynamicObject>  payload_;
+
+  public:
+    virtual void AcquirePayload(Orthanc::IDynamicObject* payload);
+
+    virtual bool HasPayload() const
+    {
+      return (payload_.get() != NULL);
+    }
+
+    virtual Orthanc::IDynamicObject& GetPayload() const;
+
+    Orthanc::IDynamicObject* ReleasePayload();
+  };
+}
--- a/Framework/Oracle/OracleCommandExceptionMessage.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/OracleCommandExceptionMessage.h	Tue Nov 05 22:39:25 2019 +0100
@@ -28,34 +28,28 @@
 
 namespace OrthancStone
 {
-  class OracleCommandExceptionMessage : public IMessage
+  class OracleCommandExceptionMessage : public IOracleCommand::OracleMessageBase
   {
     ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
 
   private:
-    const IOracleCommand&       command_;
-    Orthanc::OrthancException   exception_;
+    Orthanc::OrthancException  exception_;
 
   public:
-    OracleCommandExceptionMessage(const IOracleCommand& command,
+    OracleCommandExceptionMessage(IOracleCommand& command,
                                   const Orthanc::OrthancException& exception) :
-      command_(command),
+      OracleMessageBase(command),
       exception_(exception)
     {
     }
 
-    OracleCommandExceptionMessage(const IOracleCommand& command,
+    OracleCommandExceptionMessage(IOracleCommand& command,
                                   const Orthanc::ErrorCode& error) :
-      command_(command),
+      OracleMessageBase(command),
       exception_(error)
     {
     }
 
-    const IOracleCommand& GetCommand() const
-    {
-      return command_;
-    }
-    
     const Orthanc::OrthancException& GetException() const
     {
       return exception_;
--- a/Framework/Oracle/OracleCommandWithPayload.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#include "OracleCommandWithPayload.h"
-
-#include <Core/OrthancException.h>
-
-namespace OrthancStone
-{
-  void OracleCommandWithPayload::SetPayload(Orthanc::IDynamicObject* payload)
-  {
-    if (payload == NULL)
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
-    }
-    else
-    {
-      payload_.reset(payload);
-    }    
-  }
-
-
-  Orthanc::IDynamicObject& OracleCommandWithPayload::GetPayload() const
-  {
-    if (HasPayload())
-    {
-      return *payload_;
-    }
-    else
-    {
-      LOG(ERROR) << "OracleCommandWithPayload::GetPayload(): (!HasPayload())";
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-  }
-
-
-  Orthanc::IDynamicObject* OracleCommandWithPayload::ReleasePayload()
-  {
-    if (HasPayload())
-    {
-      return payload_.release();
-    }
-    else
-    {
-      LOG(ERROR) << "OracleCommandWithPayload::ReleasePayload(): (!HasPayload())";
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_BadSequenceOfCalls);
-    }
-  }
-}
--- a/Framework/Oracle/OracleCommandWithPayload.h	Tue Nov 05 19:01:57 2019 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2019 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Affero General Public License for more details.
- * 
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- **/
-
-
-#pragma once
-
-#include "IOracleCommand.h"
-
-#include <Core/IDynamicObject.h>
-
-#include <memory>
-
-namespace OrthancStone
-{
-  class OracleCommandWithPayload : public IOracleCommand
-  {
-  private:
-    std::auto_ptr<Orthanc::IDynamicObject>  payload_;
-
-  public:
-    void SetPayload(Orthanc::IDynamicObject* payload);
-
-    bool HasPayload() const
-    {
-      return (payload_.get() != NULL);
-    }
-
-    Orthanc::IDynamicObject& GetPayload() const;
-
-    Orthanc::IDynamicObject* ReleasePayload();
-  };
-}
--- a/Framework/Oracle/OrthancRestApiCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/OrthancRestApiCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,7 +22,7 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 #include <Core/Enumerations.h>
 
@@ -31,7 +31,7 @@
 
 namespace OrthancStone
 {
-  class OrthancRestApiCommand : public OracleCommandWithPayload
+  class OrthancRestApiCommand : public OracleCommandBase
   {
   public:
     typedef std::map<std::string, std::string>  HttpHeaders;
--- a/Framework/Oracle/ParseDicomFileCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/ParseDicomFileCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -30,7 +30,7 @@
 #endif
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 #include <Core/DicomParsing/ParsedDicomFile.h>
 
@@ -38,7 +38,7 @@
 
 namespace OrthancStone
 {
-  class ParseDicomFileCommand : public OracleCommandWithPayload
+  class ParseDicomFileCommand : public OracleCommandBase
   {
   public:
     class SuccessMessage : public OriginMessage<ParseDicomFileCommand>
--- a/Framework/Oracle/ReadFileCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/ReadFileCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,24 +22,24 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 namespace OrthancStone
 {
-  class ReadFileCommand : public OracleCommandWithPayload
+  class ReadFileCommand : public OracleCommandBase
   {
   public:
-    class SuccessMessage : public OriginMessage<ReadFileCommand>
+    class SuccessMessage : public OracleMessageBase
     {
       ORTHANC_STONE_MESSAGE(__FILE__, __LINE__);
       
     private:
-      std::string  content_;
+      std::string content_;
 
     public:
-      SuccessMessage(const ReadFileCommand& command,
+      SuccessMessage(ReadFileCommand& command,
                      std::string& content  /* will be swapped to avoid a memcpy() */) :
-        OriginMessage(command)
+        OracleMessageBase(command)
       {
         content_.swap(content);
       }
--- a/Framework/Oracle/SleepOracleCommand.h	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/SleepOracleCommand.h	Tue Nov 05 22:39:25 2019 +0100
@@ -22,11 +22,11 @@
 #pragma once
 
 #include "../Messages/IMessage.h"
-#include "OracleCommandWithPayload.h"
+#include "OracleCommandBase.h"
 
 namespace OrthancStone
 {
-  class SleepOracleCommand : public OracleCommandWithPayload
+  class SleepOracleCommand : public OracleCommandBase
   {
   private:
     unsigned int  milliseconds_;
--- a/Framework/Oracle/ThreadedOracle.cpp	Tue Nov 05 19:01:57 2019 +0100
+++ b/Framework/Oracle/ThreadedOracle.cpp	Tue Nov 05 22:39:25 2019 +0100
@@ -168,7 +168,7 @@
           
         if (command.HasPayload())
         {
-          copy->SetPayload(command.ReleasePayload());
+          copy->AcquirePayload(command.ReleasePayload());
         }
           
         sleepingCommands_->Add(item.GetReceiver(), copy.release());
--- a/Resources/CMake/OrthancStoneConfiguration.cmake	Tue Nov 05 19:01:57 2019 +0100
+++ b/Resources/CMake/OrthancStoneConfiguration.cmake	Tue Nov 05 22:39:25 2019 +0100
@@ -464,7 +464,7 @@
   ${ORTHANC_STONE_ROOT}/Framework/Messages/IObserver.h
   ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancImageCommand.cpp
   ${ORTHANC_STONE_ROOT}/Framework/Oracle/GetOrthancWebViewerJpegCommand.cpp
-  ${ORTHANC_STONE_ROOT}/Framework/Oracle/OracleCommandWithPayload.cpp
+  ${ORTHANC_STONE_ROOT}/Framework/Oracle/OracleCommandBase.cpp
   ${ORTHANC_STONE_ROOT}/Framework/Oracle/OrthancRestApiCommand.cpp
   ${ORTHANC_STONE_ROOT}/Framework/Oracle/HttpCommand.cpp
   ${ORTHANC_STONE_ROOT}/Framework/Scene2D/CairoCompositor.cpp