|
@@ -171,6 +171,11 @@ public:
|
|
|
* @param command_handler A callback function pointer to be called when
|
|
|
* a control command from a remote agent needs to be performed on the
|
|
|
* local module.
|
|
|
+ * @start_immediately If true (default), start listening to new commands
|
|
|
+ * and configuration changes asynchronously at the end of the constructor;
|
|
|
+ * if false, it will be delayed until the start() method is explicitly
|
|
|
+ * called. (This is a short term workaround for an initialization trouble.
|
|
|
+ * We'll need to develop a cleaner solution, and then remove this knob)
|
|
|
*/
|
|
|
ModuleCCSession(const std::string& spec_file_name,
|
|
|
isc::cc::AbstractSession& session,
|
|
@@ -178,9 +183,21 @@ public:
|
|
|
isc::data::ConstElementPtr new_config) = NULL,
|
|
|
isc::data::ConstElementPtr(*command_handler)(
|
|
|
const std::string& command,
|
|
|
- isc::data::ConstElementPtr args) = NULL
|
|
|
+ isc::data::ConstElementPtr args) = NULL,
|
|
|
+ bool start_immediately = true
|
|
|
);
|
|
|
|
|
|
+ /// Start asynchronous receiving new commands and configuration changes
|
|
|
+ /// asynchronously.
|
|
|
+ ///
|
|
|
+ /// This method must be called only once, and only when the ModuleCCSession
|
|
|
+ /// was constructed with start_immediately being false. Otherwise
|
|
|
+ /// CCSessionError will be thrown.
|
|
|
+ ///
|
|
|
+ /// As noted in the constructor, this method should be considered a short
|
|
|
+ /// term workaround and will be removed in future.
|
|
|
+ void start();
|
|
|
+
|
|
|
/**
|
|
|
* Optional optimization for checkCommand loop; returns true
|
|
|
* if there are unhandled queued messages in the cc session.
|
|
@@ -288,7 +305,8 @@ public:
|
|
|
private:
|
|
|
ModuleSpec readModuleSpecification(const std::string& filename);
|
|
|
void startCheck();
|
|
|
-
|
|
|
+
|
|
|
+ bool started_;
|
|
|
std::string module_name_;
|
|
|
isc::cc::AbstractSession& session_;
|
|
|
ModuleSpec module_specification_;
|