CPPSERV


Home Projects Jobs Clientele Contact
CPPSERV Documentation Download TODO Mailing lists Bug tracker News RSS Feed Browse source

serverconfig.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2004-2007 by Ilya A. Volynets-Evenbakh                  *
00003  *   ilya@total-knowledge.com                                              *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef CSERVIMPLCONFIGFILE_H
00021 #define CSERVIMPLCONFIGFILE_H
00022 
00023 #include <string>
00024 #include <map>
00025 #include <list>
00026 #include <string>
00027 #include <time.h>
00028 #include <servlet/Servlet.h>
00029 #include <ServletConfigImpl.h>
00030 #include <servletcontainer.h>
00031 #include <requestlistener.h>
00032 #include <servlet/ServletException.h>
00033 #include <util.h>
00034 
00035 #include "context.h"
00036 #include "paramregistry.h"
00037 #include "contextregistry.h"
00038 #include "globalcontext.h"
00039 #include "appcontext.h"
00040 #include "servletcontext.h"
00041 #include "cspcontext.h"
00042 
00043 namespace container {
00044 //Forward declarations
00045 class RequestListener;
00046 
00047 namespace serverconfig {
00048 
00055 class ServerConfig
00056 {
00057 protected:
00065     ConfigNode* m_root;
00066 public:
00067     ServerConfig();
00068     virtual ~ServerConfig();
00069     void processConfig();
00070     static void fart(const char*) throw (servlet::ServletException);
00071     bool setGlobalParam(const std::string& type, const std::string& value);
00072 
00077     container::RequestListener* getListener()
00078     { return m_globalContext.getListener(); }
00083     serverconfig::AppContext* getApp(const std::string& name)
00084     { return m_globalContext.getApp(name); }
00085 
00089     virtual ConfigNode::childlist_t getNodes(const ConfigNode* parent) = 0;
00099     virtual ConfigNode::childlist_t getNodes(const ConfigNode* parent, const std::string& type) = 0;
00100 private:
00101     typedef ContextRegistry::createcontext_f createcontext_f;
00102 private:
00103     GlobalContext m_globalContext;
00104 };
00105 
00106 }
00107 }
00108 
00109 #endif

SourceForge.net Logo