rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::Config Class Reference
[Core Generic Object]

Base class for classes that encapsulate information from deployment descriptors. More...

#include <rwsf/core/Config.h>

Inheritance diagram for rwsf::Config:
rwsf::HandleBase rwsf::FilterConfig rwsf::ServletConfig

List of all members.

Public Member Functions

 Config ()
 Config (const Config &config)
virtual ~Config ()
Configoperator= (const Config &rhs)
bool containsParameter (const std::string &name) const
std::string getInitParameter (const std::string &name) const
long getLongInitParameter (const std::string &key, long def=0) const
bool getBoolInitParameter (const std::string &key, bool def=false) const
rwsf::Enumeration< std::string > getInitParameterNames () const
void setInitParameter (const std::string &key, const std::string &value)
void setLongInitParameter (const std::string &key, long value)
void setBoolInitParameter (const std::string &key, bool value)

Detailed Description

rwsf::Config is the base class for classes that encapsulate information from deployment descriptors, i.e., any definition of objects to be deployed, such as those included in the web.xml file, rwagent.xml, or handlers.xml. Configuration information consists of a set of name/value pairs. The service implementation creates an instance of this class for each service instance.

An instance of rwsf::Config contains the configuration information for each object created by the Agent. When the Agent starts up, it reads in various configuration files, each with their own property lists. Each of these property lists defines initialization parameters for its parent object (rwsf::Connector, rwsf::Handler, rwsf::NamedObject, etc.). The Agent places these initialization parameters into an rwsf::Config object that then is passed to the relevant init() method for the parent object.


Constructor & Destructor Documentation

rwsf::Config::Config (  ) 

Default constructor. Creates an empty configuration object.

rwsf::Config::Config ( const Config config  ) 

Creates an additional reference to the config object.

virtual rwsf::Config::~Config (  )  [virtual]

Detaches from the current body (if any), decrements the reference count of the body, and deletes the body if there are no other references.


Member Function Documentation

bool rwsf::Config::containsParameter ( const std::string &  name  )  const

Returns true if the rwsf::Config instance contains an initialization parameter whose key matches name, otherwise false. Parameter name comparisons are case-sensitive.

bool rwsf::Config::getBoolInitParameter ( const std::string &  key,
bool  def = false 
) const

Returns the value associated with the initialization parameter key, where the value may be either true or false. If key is not found, returns def. If the value is one of the string values "true", "yes", or "1", returns true, otherwise false. The string value comparison is case-insensitive.

std::string rwsf::Config::getInitParameter ( const std::string &  name  )  const

Returns the value of the initialization parameter name. If name is not found, returns the empty string. Parameter name comparisons are case-sensitive.

rwsf::Enumeration<std::string> rwsf::Config::getInitParameterNames (  )  const

Returns an enumeration of all the parameter names defined for this object in the rwsf::Config instance. When the instance defines no initialization parameters, the enumeration is empty.

long rwsf::Config::getLongInitParameter ( const std::string &  key,
long  def = 0 
) const

Returns the value of the initialization parameter key. If key is not found, returns def.

Config& rwsf::Config::operator= ( const Config rhs  ) 

Assignment operator.

void rwsf::Config::setBoolInitParameter ( const std::string &  key,
bool  value 
)

Sets the value of the initialization parameter key to a bool value.

void rwsf::Config::setInitParameter ( const std::string &  key,
const std::string &  value 
)

Sets the value of the initialization parameter key to value.

void rwsf::Config::setLongInitParameter ( const std::string &  key,
long  value 
)

Sets the value of the initialization parameter key to a long value.


Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.