summaryrefslogtreecommitdiffstats
path: root/src/Core/ConnectionManager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Core/ConnectionManager.h')
-rw-r--r--src/Core/ConnectionManager.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Core/ConnectionManager.h b/src/Core/ConnectionManager.h
index c17bae5..86c342c 100644
--- a/src/Core/ConnectionManager.h
+++ b/src/Core/ConnectionManager.h
@@ -27,8 +27,8 @@
#include <Common/Configurable.h>
#include <Common/Exception.h>
#include <Common/HostInfo.h>
-#include <Common/Initializable.h>
#include <Common/RequestManager.h>
+#include <Common/SingletonPtr.h>
#include <Net/IPAddress.h>
@@ -45,7 +45,7 @@ namespace Core {
class ConnectionManager : public Common::Configurable {
private:
- static ConnectionManager connectionManager;
+ static Common::SingletonPtr<ConnectionManager> connectionManager;
std::string x509TrustFile, x509CrlFile, x509CertFile, x509KeyFile;
@@ -62,22 +62,20 @@ class ConnectionManager : public Common::Configurable {
ConnectionManager(const ConnectionManager &o);
ConnectionManager& operator=(const ConnectionManager &o);
- ConnectionManager() {}
-
void handleConnections(std::list<Net::ServerConnection*> &connections);
void updateState(const std::string &name, Common::HostInfo::State state);
protected:
- virtual void doInit();
- virtual void doDeinit();
-
virtual bool handleConfigEntry(const Common::ConfigEntry &entry, bool handled);
virtual void configFinished();
public:
+ ConnectionManager();
+ virtual ~ConnectionManager();
+
static ConnectionManager* get() {
- return &connectionManager;
+ return connectionManager.get();
}
void run();