HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions
rwsf::Config Class Reference

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

Public Member Functions

 Config ()
 
 Config (const Config &config)
 
virtual ~Config ()
 
bool containsParameter (const std::string &name) const
 
bool getBoolInitParameter (const std::string &key, bool def=false) const
 
std::string getInitParameter (const std::string &name) const
 
rwsf::Enumeration< std::string > getInitParameterNames () const
 
long getLongInitParameter (const std::string &key, long def=0) const
 
Configoperator= (const Config &rhs)
 
void setBoolInitParameter (const std::string &key, bool value)
 
void setInitParameter (const std::string &key, const std::string &value)
 
void setLongInitParameter (const std::string &key, long value)
 
- Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
 
bool operator!= (const HandleBase &second) const
 
bool operator== (const HandleBase &second) const
 

Additional Inherited Members

- Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
virtual ~HandleBase (void)
 
BodyBase & body (void) const
 
HandleBaseoperator= (const HandleBase &second)
 

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 © 2019 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.