TKN Logo SelfSoft Logo

Total Knowledge

SelfSoft, Inc.

CPPSERV

[CPPSERV] [Documentation] [Download] [Contact] [Bug tracker] [News] [RSS Feed] [gitweb]

container::ServerConfig::GlobalContext Class Reference

Inheritance diagram for container::ServerConfig::GlobalContext:

Inheritance graph
[legend]
Collaboration diagram for container::ServerConfig::GlobalContext:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GlobalContext (ServerConfig &cfg)
 ~GlobalContext ()
bool setGlobalParam (const std::string &, const std::string &)
std::string getGlobalParam (const std::string &type)
RequestListenergetListener ()
std::string getUriBase () const
void registerApp (const std::string &name, App *app)
AppgetApp (const std::string &name)

Protected Member Functions

virtual bool onSetParam (const ConfigNode &)
virtual ContextgetContext (const ConfigNode &node)
bool setListener (const ServerConfig::ConfigNode &)
bool setNumThreads (const ServerConfig::ConfigNode &)
bool setQueueDepth (const ServerConfig::ConfigNode &)
bool setUriBase (const ServerConfig::ConfigNode &)
bool onPostComplete ()

Static Private Member Functions

static void registerParams (ParamRegistry< ServerConfig::GlobalContext > &)
static void registerContexts (ContextRegistry &)

Private Attributes

std::list< GlobalConfigNode * > globalNodes
std::map< std::string, std::string > globals
std::list< RequestListener::Acceptor * > m_acceptors
std::map< std::string, App * > m_apps
std::string m_uribase
int m_nThreads
int m_queueDepth
RequestListenerm_listener
CThreadPoolm_pool

Static Private Attributes

static ContextRegistry contextregistry
static ParamRegistry< GlobalContextparamregistry

Classes

class  GlobalConfigNode

Detailed Description

This context handles global arguments and takes care of matching them with command line arguments, that can override config file parameters. Such command line arguments will be passed to us by ServerConfig::setGlobalParam() function.

Definition at line 286 of file serverconfig.h.


Constructor & Destructor Documentation

container::ServerConfig::GlobalContext::GlobalContext ( ServerConfig cfg  ) 

Definition at line 181 of file serverconfig.cpp.

References container::ServerConfig::ParamRegistry< T >::getParamList(), container::ServerConfig::Context::getUnsetParams(), and paramregistry.

Here is the call graph for this function:

container::ServerConfig::GlobalContext::~GlobalContext (  ) 

Definition at line 450 of file serverconfig.cpp.

References globalNodes, m_acceptors, m_listener, and m_pool.


Member Function Documentation

void container::ServerConfig::GlobalContext::registerParams ( ParamRegistry< ServerConfig::GlobalContext > &   )  [static, private]

void container::ServerConfig::GlobalContext::registerContexts ( ContextRegistry  )  [static, private]

Definition at line 264 of file serverconfig.cpp.

References container::ServerConfig::AppContext::contextCreator(), and container::ServerConfig::ContextRegistry::registerContext().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::onSetParam ( const ConfigNode  )  [protected, virtual]

Implements container::ServerConfig::Context.

Definition at line 230 of file serverconfig.cpp.

References paramregistry, and container::ServerConfig::ParamRegistry< T >::setParam().

Here is the call graph for this function:

virtual Context* container::ServerConfig::GlobalContext::getContext ( const ConfigNode node  )  [inline, protected, virtual]

Parameters:
node Finds context for node with the name. Derived classes should override this function to search in their own context registries.

Implements container::ServerConfig::Context.

Definition at line 330 of file serverconfig.h.

References contextregistry, and container::ServerConfig::ContextRegistry::getContext().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::setListener ( const ServerConfig::ConfigNode node  )  [protected]

Creates and registers an acceptor. configNode should have protocol param (with value "unix" or "tcp"), and either host & port params for tcp, or path param for unix protocols.

Definition at line 480 of file serverconfig.cpp.

References container::ServerConfig::ConfigNode::getAttrs(), and m_acceptors.

Referenced by registerParams().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::setNumThreads ( const ServerConfig::ConfigNode  )  [protected]

Definition at line 528 of file serverconfig.cpp.

References container::ServerConfig::ConfigNode::getAttrs(), and m_nThreads.

Referenced by registerParams().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::setQueueDepth ( const ServerConfig::ConfigNode  )  [protected]

Definition at line 539 of file serverconfig.cpp.

References container::ServerConfig::ConfigNode::getAttrs(), and m_queueDepth.

Referenced by registerParams().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::setUriBase ( const ServerConfig::ConfigNode  )  [protected]

Definition at line 550 of file serverconfig.cpp.

References container::ServerConfig::ConfigNode::getAttrs(), and m_uribase.

Referenced by registerParams().

Here is the call graph for this function:

bool container::ServerConfig::GlobalContext::onPostComplete (  )  [protected, virtual]

called after child contexts' complete()

Reimplemented from container::ServerConfig::Context.

Definition at line 568 of file serverconfig.cpp.

References m_acceptors, m_listener, m_nThreads, m_pool, and m_queueDepth.

bool container::ServerConfig::GlobalContext::setGlobalParam ( const std::string &  ,
const std::string &   
)

Definition at line 443 of file serverconfig.cpp.

References globalNodes, and container::ServerConfig::Context::setParam().

Referenced by container::ServerConfig::setGlobalParam().

Here is the call graph for this function:

std::string container::ServerConfig::GlobalContext::getGlobalParam ( const std::string &  type  ) 

Definition at line 469 of file serverconfig.cpp.

References globals.

Referenced by container::ServerConfig::getGlobalParam().

RequestListener* container::ServerConfig::GlobalContext::getListener (  )  [inline]

Definition at line 342 of file serverconfig.h.

References m_listener.

Referenced by container::ServerConfig::getListener().

std::string container::ServerConfig::GlobalContext::getUriBase (  )  const [inline]

Definition at line 343 of file serverconfig.h.

References m_uribase.

void container::ServerConfig::GlobalContext::registerApp ( const std::string &  name,
App app 
) [inline]

Definition at line 344 of file serverconfig.h.

References m_apps.

Referenced by container::ServerConfig::AppContext::onPreComplete().

App* container::ServerConfig::GlobalContext::getApp ( const std::string &  name  )  [inline]

Definition at line 345 of file serverconfig.h.

References m_apps.

Referenced by container::ServerConfig::getApp().


Member Data Documentation

std::map<std::string, std::string> container::ServerConfig::GlobalContext::globals [private]

Definition at line 304 of file serverconfig.h.

Referenced by getGlobalParam().

std::map<std::string, App*> container::ServerConfig::GlobalContext::m_apps [private]

Definition at line 306 of file serverconfig.h.

Referenced by getApp(), and registerApp().

Definition at line 307 of file serverconfig.h.

Referenced by getUriBase(), and setUriBase().

This variable holds number of threads processing task queue. Essentially - maximum number of simulteniously processed connections. Currently it is also used to initialize request queue depth

Definition at line 315 of file serverconfig.h.

Referenced by onPostComplete(), and setNumThreads().

This variable holds maximum number of connections that can be held in queue for processing. Normally this should not be larger then number of threads.

Definition at line 322 of file serverconfig.h.

Referenced by onPostComplete(), and setQueueDepth().


The documentation for this class was generated from the following files:

SourceForge.net Logo

Authoright © Total Knowledge: 2001-2004