00001 /*************************************************************************** 00002 * Copyright (C) 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 00021 #ifndef _SERVERCONFIG_SERVLETCONTEXT_H_ 00022 #define _SERVERCONFIG_SERVLETCONTEXT_H_ 00023 00024 namespace container { 00025 namespace serverconfig { 00026 00037 class ServletContext: 00038 public Context 00039 { 00040 static ContextRegistry m_contextregistry; 00041 static ParamRegistry<ServletContext> m_paramregistry; 00042 std::string m_dso; 00043 bool m_hidden; 00044 util::pairlist_t m_params; 00045 std::string m_path; 00046 size_t m_maxRequestSize; 00047 size_t m_maxFileSize; 00048 private: 00049 static void registerParams(ParamRegistry<ServletContext>&); 00050 static void registerContexts(ContextRegistry&); 00051 protected: 00052 virtual bool onSetParam(const ConfigNode&); 00053 virtual bool onPostComplete(); 00054 virtual Context* getContext(const ConfigNode& node) 00055 { return m_contextregistry.getContext(node, this); } 00056 bool addInitParam(const ConfigNode&); 00057 bool setMaxRequestSize(const ConfigNode&); 00058 bool setMaxFileSize(const ConfigNode&); 00059 virtual std::string getServletName(); 00060 public: 00061 ServletContext(Context* parent, const std::string& path, const std::string& dso, bool hidden); 00062 static Context* contextCreator(const ConfigNode& n, Context* parent); 00063 }; 00064 00065 } 00066 } 00067 #endif // _SERVERCONFIG_SERVLETCONTEXT_H_