# wso2wsf::Environment Class Reference
[Environment]

Class Environment wraps the underlying axis2_environment which deals with memory allocation, threading, logging and error handling within the framework. Environment class hides all the complexcities of these and provides a simple interface. All the methods defined within the environment class are static. The method Environment::initialize() must be called before invoking any other methods from the WSF/CPP Framework for client side. More...

`#include <Environment.h>`

List of all members.

## Public Member Functions
| Environment ()
| ~Environment ()
## Static Public Member Functions
static WSF_EXTERN void | setEnv (const axutil_env_t *env)
static WSF_EXTERN const axutil_env_t * | getEnv ()
static WSF_EXTERN void | removeEnv ()
static WSF_EXTERN void | switchToGlobalPool ()
static WSF_EXTERN void | switchToLocalPool ()
static WSF_EXTERN void | initialize (std::string logFileName, axutil_log_levels_t logLevel)
## Static Public Attributes
static std::string | _logFileName
static axutil_log_levels_t | _logLevel

## Detailed Description

Class Environment wraps the underlying axis2_environment which deals with memory allocation, threading, logging and error handling within the framework. Environment class hides all the complexcities of these and provides a simple interface. All the methods defined within the environment class are static. The method Environment::initialize() must be called before invoking any other methods from the WSF/CPP Framework for client side.

## Constructor & Destructor Documentation

wso2wsf::Environment::Environment | ( |  | ) |

Constructor for the Environment class

wso2wsf::Environment::~Environment | ( |  | ) |

Destructor for Environment Object

## Member Function Documentation

static WSF_EXTERN const axutil_env_t* wso2wsf::Environment::getEnv | ( |  | ) | `[static]`

Get the environment related to current thread context

static WSF_EXTERN void wso2wsf::Environment::initialize | ( | std::string | logFileName,
|  | axutil_log_levels_t | logLevel |
| ) |  |  | `[static]`

Initialize with log file and log level. This function must be called prior to using the framework for client side. For the server, calling the method for initialization is not required

Parameters:

  | logFileName | name of the log file name which will be created by the environment and used to write logs.
  | logLevel | The level of details that should be written to the log file. There are several log levels available. 1. WSF_LOG_LEVEL_CRITICAL Only Critical level logs will be written. Suitable for production deployment. 2. WSF_LOG_LEVEL_ERROR Only Error messages will be written to the log. 3. WSF_LOG_LEVEL_INFO Logs information 4. WSF_LOG_LEVEL_DEBUG logs everything 5. WSF_LOG_LEVEL_USER log user level messages. 6. WSF_LOG_LEVEL_TRACE Trace Level logging.

static WSF_EXTERN void wso2wsf::Environment::removeEnv | ( |  | ) | `[static]`

Remove the environment related to current thread context.

static WSF_EXTERN void wso2wsf::Environment::setEnv | ( | const axutil_env_t * | env | ) | `[static]`

Method to store the current thread specific environment.

Parameters:

  | env | Pointer to the axutil_env

static WSF_EXTERN void wso2wsf::Environment::switchToGlobalPool | ( |  | ) | `[static]`

Switch to global memory pool

static WSF_EXTERN void wso2wsf::Environment::switchToLocalPool | ( |  | ) | `[static]`

Switch to local memory pool

## Member Data Documentation

std::string wso2wsf::Environment::_logFileName`[static]`

keeps the log file name

axutil_log_levels_t wso2wsf::Environment::_logLevel`[static]`

keeps the log level

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

- Environment.h