Public Member Functions | Protected Member Functions | Private Attributes | Friends

wosh::SystemMonitor Class Reference
[Core-Modules]

CoreModule designed for diagnostic purposes, collects wosh::SystemInfo system information and provides access to profiling data (when enabled). More...

#include <H:/WOSH/win32_vc2010/src/core/SystemMonitor.h>

List of all members.

Public Member Functions

virtual ~SystemMonitor ()
 Destructor. SystemInfo list is destroyed (nested).
Public methods
WRESULT updateSystemInfo ()
 Update System information, the fields are OS-dependent. Reentrant.
const tSystemInfoListgetSystemInfos () const
long getSystemInfosMaxSize () const
WRESULT installSystemInfoProxy (SystemInfoProxy *systeminfo_proxy)
WRESULT installSystemInfoProxy (const std::string &systeminfo_proxy_classname, double version=0.0)
WRESULT installSystemInfoProxies (const std::string &systeminfo_proxy_classname_pattern)
Message Events (incoming message)
void busMessage (const Message &message, const Bus *source)
 Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Protected Member Functions

 SystemMonitor (const WoshKernel *parent=NULL)
 Default constructor. Call base constructor and initialize some properties and hosted methods.
WRESULT onKernelInitializing ()
 Call base class implementation and (synch) update system informations.
WRESULT onKernelInitialized ()
 Event raised synchonously by the Kernel when switching to WoshKernel::STATE_INITIALIZED state.
WRESULT onKernelStopped ()
 Eventually save SystemInfos list and call base class implementation.

Private Attributes

long systemInfoTs
 timestamp of system-info data (epoch in seconds)

Friends

class wosh::WoshKernel

IPropertiesProviderListener interface

class wosh::PropertiesProvider
bool readingProperty (Property *property_curr, const PropertiesProvider *source)

Internal Mehods and SystemInfo management

class wosh::SystemInfo
 allow some access from my child-object
static WRESULT save (SystemInfo *error, const Object *source=NULL, bool raise_message=false)
static SystemMonitorgetInstance ()
 Access the SystemMonitor singleton. Gamma Pattern. Static reference is allocated and detroyed by WoshKernel on constructor/destructor respectively.
WRESULT updateSystemInfo_ (bool lock_props, bool force_update)
 Update System information, the fields are OS-dependent.

Detailed Description

CoreModule designed for diagnostic purposes, collects wosh::SystemInfo system information and provides access to profiling data (when enabled).

SystemMonitor.png

wosh::SystemMonitor UML diagram

Version:
0.8.161
Id:
SystemMonitor.h 3775 2011-01-01 16:38:17Z alex
Author:
Alessandro Polo

Definition at line 108 of file SystemMonitor.h.


Constructor & Destructor Documentation

wosh::SystemMonitor::SystemMonitor ( const WoshKernel parent = NULL ) [protected]

Default constructor. Call base constructor and initialize some properties and hosted methods.

Parameters:
parent[in] WoshKernel singleton, passed to WoshModule constructor
Note:
Called by WoshKernel only. Static getter (gamma singleton) will return NULL until kernel is created.

Definition at line 87 of file SystemMonitor.cpp.

References _METHOD_Retrieve, wosh::LOG_DEBUG, wosh::LOG_INFO, and wosh::LOG_VERBOSE.

wosh::SystemMonitor::~SystemMonitor (  ) [virtual]

Destructor. SystemInfo list is destroyed (nested).

Definition at line 136 of file SystemMonitor.cpp.

References wosh::LOG_DEBUG, and wosh::LOG_VERBOSE.


Member Function Documentation

void wosh::SystemMonitor::busMessage ( const Message message,
const Bus source 
) [virtual]

Method raised by the Bus when it processes a new message. Implementations will probably analyze the message and perform actions.

Parameters:
[in]messagethe incoming message
[in]sourcethe source Bus of the incoming message
Warning:
The current thread is own and managed by the caller Bus. Heavy, dangerous or time expensive operations should be executed asynchronously and not inline!

Reimplemented from wosh::WoshModule.

Definition at line 268 of file SystemMonitor.cpp.

References wosh::Message::getContent(), wosh::Message::getSourceUUID(), wosh::Message::isEmpty(), wosh::MessageContent::isSystemInfo(), and wosh::LOG_INFO.

SystemMonitor * wosh::SystemMonitor::getInstance (  ) [static, private]

Access the SystemMonitor singleton. Gamma Pattern. Static reference is allocated and detroyed by WoshKernel on constructor/destructor respectively.

Returns:
pointer to SystemMonitor singleton. May be NULL (if kernel has not been allocated yet)

Definition at line 75 of file SystemMonitor.cpp.

WRESULT wosh::SystemMonitor::onKernelInitialized (  ) [protected, virtual]

Event raised synchonously by the Kernel when switching to WoshKernel::STATE_INITIALIZED state.

Returns:
WRET_OK on success, custom error code on errors

Reimplemented from wosh::WoshModule.

Definition at line 170 of file SystemMonitor.cpp.

References wosh::LOG_INFO, and WRET_OK.

WRESULT wosh::SystemMonitor::onKernelInitializing (  ) [protected, virtual]

Call base class implementation and (synch) update system informations.

Returns:
result of WoshModule::onKernelInitializing() + updateSystemInfo
See also:
updateSystemInfo()

Reimplemented from wosh::WoshModule.

Definition at line 157 of file SystemMonitor.cpp.

References getCurrentProcessPID(), and wosh::LOG_INFO.

WRESULT wosh::SystemMonitor::onKernelStopped (  ) [protected, virtual]

Eventually save SystemInfos list and call base class implementation.

Returns:
result of WoshModule::onKernelInitializing() + mmDoSaveErrors
See also:
mmDoSaveErrors()

Reimplemented from wosh::WoshModule.

Definition at line 187 of file SystemMonitor.cpp.

References wosh::LOG_CRITICAL, wosh::LOG_INFO, and WRET_OK.

WRESULT wosh::SystemMonitor::save ( SystemInfo error,
const Object source = NULL,
bool  raise_message = false 
) [static, protected]
WRESULT wosh::SystemMonitor::updateSystemInfo (  ) [inline]

Update System information, the fields are OS-dependent. Reentrant.

Returns:
WRET_OK on success, a custom error code on failure while gathering information
See also:
updateSystemInfo_()

Definition at line 158 of file SystemMonitor.h.

References updateSystemInfo_().

WRESULT wosh::SystemMonitor::updateSystemInfo_ ( bool  lock_props,
bool  force_update 
) [private]

Update System information, the fields are OS-dependent.

Parameters:
lock_props[in] when true the method is reentrant, else it won't lock Properties list
force_update[in] flag used to ignore data-timeout evaluation
Returns:
WRET_ERR_ILLEGAL_USE if force_update is false and data is up-to-date; WRET_ERR_INTERNAL on errors; WRET_OK else

Definition at line 214 of file SystemMonitor.cpp.

References getCurrentProcessPID(), wosh::LOG_CRITICAL, wosh::LOG_VERBOSE, retrieveProcessInfo(), WRET_ERR_ILLEGAL_USE, WRET_ERR_INTERNAL, and WRET_OK.

Referenced by updateSystemInfo().


Friends And Related Function Documentation

friend class wosh::SystemInfo [friend]

allow some access from my child-object

Definition at line 187 of file SystemMonitor.h.


Member Data Documentation

timestamp of system-info data (epoch in seconds)

Definition at line 216 of file SystemMonitor.h.


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

Generated on Tue Feb 8 2011 09:33:32 for WOSH system 0.8.888 [wolf] by Alessandro Polo, using DoxyGen 1.7.2 hosted by WOSH Framework