- Timestamp:
- 01/30/10 15:53:00 (6 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Enterprise/branches/0075_TR_SCRIPTING/AppServer/src/ApplicationServer.hpp
r3331 r3336 3 3 // 4 4 // Copyright (C) 2001 - 2010 Tony Richards 5 // Copyright (C) 2008 - 20 09Matthew Alan Gray5 // Copyright (C) 2008 - 2010 Matthew Alan Gray 6 6 // Copyright (C) 2009 Joshua Cassity 7 7 // … … 31 31 #include "../I_ApplicationServer.hpp" 32 32 33 #include <Zen/Core/Threading/I_Thread.hpp> 33 34 #include <Zen/Core/Threading/ThreadPool.hpp> 34 35 … … 40 41 //-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ 41 42 namespace Zen { 43 namespace Database { 44 class I_DatabaseService; 45 class I_DatabaseConnection; 46 } // namespace Database 42 47 namespace Enterprise { 43 48 namespace AppServer { … … 86 91 virtual void handleRequest(pRequest_type _pRequest, pResponseHandler_type _pResponseHandler); 87 92 virtual void handleSessionEvent(pSessionEvent_type _pSessionEvent); 93 virtual pDatabaseConnection_type getDatabaseConnection(const std::string& _database, Zen::Threading::I_Thread::ThreadId& _threadId); 88 94 /// @} 89 95 … … 108 114 109 115 Threading::ThreadPool& getSharedThreadPool() { return m_sharedThreadPool; } 116 /// @} 117 118 /// @name Inner classes 119 /// @{ 120 private: 121 class DatabaseConnections 122 { 123 /// @name Types 124 /// @{ 125 public: 126 typedef Zen::Memory::managed_ptr<Zen::Database::I_DatabaseService> pDatabaseService_type; 127 typedef std::map<std::string,std::string> config_type; 128 typedef Zen::Memory::managed_ptr<Zen::Database::I_DatabaseConnection> pDatabaseConnection_type; 129 typedef std::map<Zen::Threading::I_Thread::ThreadId,pDatabaseConnection_type> DatabaseConnections_type; 130 /// @} 131 132 /// @name DatabaseConnections implementation 133 /// @{ 134 public: 135 pDatabaseConnection_type getConnection(Zen::Threading::I_Thread::ThreadId& _threadId); 136 /// @} 137 138 /// @name 'Structors 139 /// @{ 140 DatabaseConnections(pDatabaseService_type _pService, config_type _connectionConfig); 141 ~DatabaseConnections(); 142 /// @} 143 144 /// @name Member Variables 145 /// @{ 146 private: 147 pDatabaseService_type m_pDatabaseService; 148 config_type m_connectionConfig; 149 DatabaseConnections_type m_databaseConnections; 150 Zen::Threading::I_Mutex* m_databaseConnectionsMutex; 151 /// @} 152 153 }; // class DatabaseConnections 110 154 /// @} 111 155 … … 156 200 157 201 pMessageRegistry_type m_pMessageRegistry_type; 202 203 typedef std::map<std::string, DatabaseConnections> DatabaseConnectionsMap_type; 204 DatabaseConnectionsMap_type m_databaseConnectionsMap; 158 205 /// @} 159 206
