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.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/Core/ConnectionManager.h b/src/Core/ConnectionManager.h
index 29ed280..e9565f9 100644
--- a/src/Core/ConnectionManager.h
+++ b/src/Core/ConnectionManager.h
@@ -23,13 +23,15 @@
#include <list>
#include <vector>
#include <map>
-#include <memory>
#include <Common/Configurable.h>
#include <Common/Exception.h>
#include <Common/HostInfo.h>
+#include <Common/Initializable.h>
#include <Common/RequestManager.h>
+#include <Net/IPAddress.h>
+
namespace Mad {
namespace Net {
@@ -41,9 +43,9 @@ class Packet;
namespace Core {
-class ConnectionManager : private Common::Configurable {
+class ConnectionManager : public Common::Initializable, public Common::Configurable {
private:
- static std::auto_ptr<ConnectionManager> connectionManager;
+ static ConnectionManager connectionManager;
std::string x509TrustFile, x509CrlFile, x509CertFile, x509KeyFile;
@@ -60,27 +62,24 @@ class ConnectionManager : private Common::Configurable {
ConnectionManager(const ConnectionManager &o);
ConnectionManager& operator=(const ConnectionManager &o);
- ConnectionManager();
+ 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:
static ConnectionManager* getConnectionManager() {
- return connectionManager.get();
+ return &connectionManager;
}
- static void init() {
- connectionManager = std::auto_ptr<ConnectionManager>(new ConnectionManager());
- }
-
- ~ConnectionManager();
-
void run();
Net::Connection* getDaemonConnection(const std::string &name) const throw (Common::Exception&);