comparison OrthancServer/main.cpp @ 1741:06addfcd1d4c

OrthancStarted and OrthancStopped events in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Oct 2015 16:49:17 +0200
parents e2675b37eb01
children d143db00a794
comparison
equal deleted inserted replaced
1740:5e99a70b0635 1741:06addfcd1d4c
595 static bool WaitForExit(ServerContext& context, 595 static bool WaitForExit(ServerContext& context,
596 OrthancRestApi& restApi) 596 OrthancRestApi& restApi)
597 { 597 {
598 LOG(WARNING) << "Orthanc has started"; 598 LOG(WARNING) << "Orthanc has started";
599 599
600 #if ORTHANC_PLUGINS_ENABLED == 1
601 if (context.HasPlugins())
602 {
603 context.GetPlugins().SignalOrthancStarted();
604 }
605 #endif
606
600 context.GetLua().Execute("Initialize"); 607 context.GetLua().Execute("Initialize");
601 608
602 Toolbox::ServerBarrier(restApi.LeaveBarrierFlag()); 609 Toolbox::ServerBarrier(restApi.LeaveBarrierFlag());
603 bool restart = restApi.IsResetRequestReceived(); 610 bool restart = restApi.IsResetRequestReceived();
604 611
605 context.GetLua().Execute("Finalize"); 612 context.GetLua().Execute("Finalize");
613
614 #if ORTHANC_PLUGINS_ENABLED == 1
615 if (context.HasPlugins())
616 {
617 context.GetPlugins().SignalOrthancStopped();
618 }
619 #endif
606 620
607 if (restart) 621 if (restart)
608 { 622 {
609 LOG(WARNING) << "Reset request received, restarting Orthanc"; 623 LOG(WARNING) << "Reset request received, restarting Orthanc";
610 } 624 }