14#include <boost/shared_ptr.hpp>
31static const std::string VERSION_GET_COMMAND(
"version-get");
34static const std::string BUILD_REPORT_COMMAND(
"build-report");
37static const std::string CONFIG_GET_COMMAND(
"config-get");
40static const std::string CONFIG_HASH_GET_COMMAND(
"config-hash-get");
43static const std::string CONFIG_WRITE_COMMAND(
"config-write");
46static const std::string CONFIG_TEST_COMMAND(
"config-test");
49static const std::string CONFIG_RELOAD_COMMAND(
"config-reload");
52static const std::string CONFIG_SET_COMMAND(
"config-set");
55static const std::string SERVER_TAG_GET_COMMAND(
"server-tag-get");
58static const std::string SHUT_DOWN_COMMAND(
"shutdown");
61static const std::string STATUS_GET_COMMAND(
"status-get");
89 : app_name_(app_name), io_service_(io_service), shut_down_flag_(false),
145 bool check_only =
false) = 0;
149 io_service_->stopAndPoll();
156 return (shut_down_flag_);
163 shut_down_flag_ = value;
177 return (io_service_);
198 std::string app_name_;
204 std::atomic<bool> shut_down_flag_;
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Exception thrown if the process encountered an operational error.
DProcessBaseError(const char *file, size_t line, const char *what)
Application Process Interface.
virtual void init()=0
May be used after instantiation to perform initialization unique to application.
void setShutdownFlag(bool value)
Sets the process shut down flag to the given value.
DProcessBase(const char *app_name, asiolink::IOServicePtr io_service, DCfgMgrBasePtr cfg_mgr)
Constructor.
void stopIOService()
Convenience method for stopping IOservice processing.
virtual isc::data::ConstElementPtr shutdown(isc::data::ConstElementPtr args)=0
Initiates the process's shutdown process.
const std::string getAppName() const
Fetches the application name.
virtual ~DProcessBase()
Destructor.
virtual void run()=0
Implements the process's event loop.
bool shouldShutdown() const
Checks if the process has been instructed to shut down.
asiolink::IOServicePtr & getIOService()
Fetches the controller's IOService.
virtual isc::data::ConstElementPtr configure(isc::data::ConstElementPtr config_set, bool check_only=false)=0
Processes the given configuration.
DCfgMgrBasePtr & getCfgMgr()
Fetches the process's configuration manager.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< DCfgMgrBase > DCfgMgrBasePtr
Defines a shared pointer to DCfgMgrBase.
boost::shared_ptr< DProcessBase > DProcessBasePtr
Defines a shared pointer to DProcessBase.
Defines the logger used by the top-level component of kea-lfc.