NCBI C++ ToolKit
|
#include "task_server_pch.hpp"
#include <corelib/metareg.hpp>
#include <corelib/ncbifile.hpp>
#include "server_core.hpp"
#include "threads_man.hpp"
#include "sockets_man.hpp"
#include "timers.hpp"
#include "logging.hpp"
#include "time_man.hpp"
#include "memory_man.hpp"
#include <string.h>
Go to the source code of this file.
Go to the SVN repository for this file.
Namespaces | |
boost | |
Functions | |
void | boost::assertion_failed (char const *expr, char const *func, char const *file, long line) |
static bool | s_IsReadyForShutdown (void) |
void | TrackShuttingDown (void) |
static void | s_TermHandler (int) |
static void | s_InitSignals (void) |
static bool | s_LoadConfFile (CNcbiRegistry *®) |
static void | s_ConfigureTaskServer (const CNcbiRegistry *reg, CTempString section) |
static bool | s_ReadConfiguration (void) |
string | GetConfName (void) |
void | ExtractFileName (const char *file, const char *&file_name, size_t &name_size) |
static bool | s_ProcessParameters (int &argc, const char **argv) |
Variables | |
EServerState | s_SrvState = eSrvNotInitialized |
static EServerState | s_SeenSDState = eSrvRunning |
static CSrvTime | s_ShutdownStartTime |
static int | s_ShutdownTO = 0 |
static int | s_SlowShutdownTO = 10 |
static int | s_FastShutdownTO = 2 |
static int | s_AbortShutdownTO = 0 |
static CNcbiRegistry * | s_Registry = NULL |
static string | s_ConfName |
string | s_AppBaseName |
static CMiniMutex | s_SDListLock |
static TShutdownList | s_ShutdownList |
static const char | kSection [] = "task_server" |
Definition at line 265 of file server_core.cpp.
References file, and file_name.
Referenced by s_ProcessParameters(), CSrvDiagMsg::StartSrvLog(), and SDiagMessage::Write().
string GetConfName | ( | void | ) |
Definition at line 255 of file server_core.cpp.
References s_AppBaseName, and s_ConfName.
Referenced by CNCHeartBeat::CheckConfFile(), main(), s_LoadConfFile(), and CNCServer::WriteEnvInfo().
|
static |
Definition at line 189 of file server_core.cpp.
References IRegistry::GetInt(), kSection, s_AbortShutdownTO, s_FastShutdownTO, and s_SlowShutdownTO.
Referenced by CTaskServer::ReConfig(), and s_ReadConfiguration().
|
static |
Definition at line 142 of file server_core.cpp.
References NULL, and s_TermHandler().
Referenced by CTaskServer::Initialize().
Definition at line 93 of file server_core.cpp.
References CMiniMutex::Lock(), NON_CONST_ITERATE, result, s_SDListLock, s_ShutdownList, and CMiniMutex::Unlock().
Referenced by TrackShuttingDown().
|
static |
Definition at line 158 of file server_core.cpp.
References Critical(), CMetaRegistry::eName_AsIs, CMetaRegistry::eName_Ini, GetConfName(), in(), CMetaRegistry::Load(), IRWRegistry::Read(), CMetaRegistry::SEntry::registry, s_AppBaseName, s_ConfName, and SRV_LOG.
Referenced by CTaskServer::ReadConfiguration(), and s_ReadConfiguration().
Definition at line 280 of file server_core.cpp.
References CDirEntry::ConcatPath(), Critical(), ExtractFileName(), file_name, CDir::GetCwd(), i, CDirEntry::IsAbsolutePath(), memmove, CDirEntry::NormalizePath(), s_AppBaseName, s_ConfName, SaveAppCmdLine(), SetLogFileName(), and SRV_LOG.
Referenced by CTaskServer::Initialize().
Definition at line 197 of file server_core.cpp.
References ConfigureLogging(), ConfigureScheduler(), ConfigureSockets(), ConfigureThreads(), ConfigureTimeMan(), Critical(), kSection, s_ConfigureTaskServer(), s_LoadConfFile(), s_Registry, and SRV_LOG.
Referenced by CTaskServer::Initialize().
Definition at line 136 of file server_core.cpp.
References eSrvFastShutdown, and CTaskServer::RequestShutdown().
Referenced by s_InitSignals().
void TrackShuttingDown | ( | void | ) |
Definition at line 105 of file server_core.cpp.
References CSrvTime::Current(), Error(), eSrvRunning, eSrvShuttingDownHard, eSrvShuttingDownSoft, eSrvStopping, FireAllTimers(), RequestStopListening(), s_AbortShutdownTO, s_IsReadyForShutdown(), s_LastJiffyTime, s_SeenSDState, s_ShutdownStartTime, s_ShutdownTO, s_SrvState, SchedIsAllIdle(), CSrvTime::Sec(), SRV_FATAL, SRV_LOG, and Warning().
Referenced by s_ServiceThreadMain().
|
static |
Definition at line 80 of file server_core.cpp.
Referenced by CTaskServer::ReConfig(), s_ConfigureTaskServer(), and s_ReadConfiguration().
|
static |
Definition at line 74 of file server_core.cpp.
Referenced by s_ConfigureTaskServer(), TrackShuttingDown(), and CTaskServer::WriteSetup().
string s_AppBaseName |
Definition at line 77 of file server_core.cpp.
Referenced by GetConfName(), s_AddLogPrefix(), s_InitFileName(), s_LoadConfFile(), s_ProcessParameters(), and s_SetCurThread().
|
static |
Definition at line 76 of file server_core.cpp.
Referenced by GetConfName(), s_LoadConfFile(), and s_ProcessParameters().
|
static |
Definition at line 73 of file server_core.cpp.
Referenced by CTaskServer::RequestShutdown(), s_ConfigureTaskServer(), and CTaskServer::WriteSetup().
|
static |
Definition at line 75 of file server_core.cpp.
Referenced by CTaskServer::GetConfRegistry(), CGuiRegistry::GetInstance(), s_ReadConfiguration(), and CTaskServer::SetConfRegistry().
|
static |
Definition at line 78 of file server_core.cpp.
Referenced by CTaskServer::AddShutdownCallback(), and s_IsReadyForShutdown().
|
static |
Definition at line 69 of file server_core.cpp.
Referenced by TrackShuttingDown().
|
static |
Definition at line 79 of file server_core.cpp.
Referenced by CTaskServer::AddShutdownCallback(), and s_IsReadyForShutdown().
|
static |
Definition at line 70 of file server_core.cpp.
Referenced by TrackShuttingDown().
|
static |
Definition at line 71 of file server_core.cpp.
Referenced by CTaskServer::RequestShutdown(), and TrackShuttingDown().
|
static |
Definition at line 72 of file server_core.cpp.
Referenced by CTaskServer::RequestShutdown(), s_ConfigureTaskServer(), and CTaskServer::WriteSetup().
EServerState s_SrvState = eSrvNotInitialized |
Definition at line 68 of file server_core.cpp.
Referenced by CTaskServer::Initialize(), CTaskServer::IsInHardShutdown(), CTaskServer::IsInShutdown(), CTaskServer::IsInSoftShutdown(), CTaskServer::IsRunning(), IsServerStopping(), CTaskServer::RequestShutdown(), CTaskServer::Run(), s_PerJiffyTasks_Worker(), and TrackShuttingDown().