pion::platform::ReactionEngine Class Reference

#include <ReactionEngine.hpp>

Inherits pion::platform::PluginConfig< PluginType >< pion::platform::Reactor >.

List of all members.


Detailed Description

ReactionEngine: manages all of the registered Reactors and connections, and routes Events between Reactors

Definition at line 47 of file ReactionEngine.hpp.

Public Member Functions

 ReactionEngine (VocabularyManager &vocab_mgr, CodecFactory &codec_factory, ProtocolFactory &protocol_factory, DatabaseManager &database_mgr)
virtual ~ReactionEngine ()
 virtual destructor
virtual void openConfigFile (void)
 opens an existing configuration file and loads the plug-ins it contains
void clearReactorStats (const std::string &reactor_id)
void start (void)
 starts all Event processing (does not start collection Reactors)
void stop (void)
 stops all Event processing (stops all Reactors and terminates all connections)
void shutdown (void)
 shuts down the reaction engine -> stops all threads and releases plugins
void clearStats (void)
 clears statistic counters for all Reactors
void updateCodecs (void)
 this updates all of the Codecs used by Reactors
void updateDatabases (void)
 this updates all of the Databases used by Reactors
void updateProtocols (void)
 this updates all of the Protocols used by Reactors
void restartReactorsThatShouldBeRunning (void)
 attempts to start all reactors that should be initialized in a "running" state and are not running
void startReactor (const std::string &reactor_id)
void stopReactor (const std::string &reactor_id)
void setReactorConfig (const std::string &reactor_id, const xmlNodePtr config_ptr)
void setReactorLocation (const std::string &reactor_id, const xmlNodePtr config_ptr)
std::string addReactor (const xmlNodePtr config_ptr)
void removeReactor (const std::string &reactor_id)
ReactoraddTempConnectionIn (const std::string &reactor_id, const std::string &connection_id, const std::string &connection_info, boost::function0< void > removed_handler)
void addTempConnectionOut (const std::string &reactor_id, const std::string &connection_id, const std::string &connection_info, Reactor::EventHandler connection_handler)
void removeTempConnection (const std::string &connection_id)
std::string addReactorConnection (const std::string &from_id, const std::string &to_id)
std::string addReactorConnection (const xmlNodePtr config_ptr)
void removeReactorConnection (const std::string &from_id, const std::string &to_id)
void removeReactorConnection (const std::string &connection_id)
std::string addWorkspace (const char *content_buf, std::size_t content_length)
void removeWorkspace (const std::string &workspace_id)
void removeReactorsFromWorkspace (const std::string &workspace_id)
void setWorkspaceConfig (const std::string &workspace_id, const char *content_buf, std::size_t content_length)
void writeStatsXML (std::ostream &out, const std::string &reactor_id="", const bool details=false)
void writeConnectionsXML (std::ostream &out, const std::string &only_id) const
void writeConnectionsXML (std::ostream &out) const
bool writeWorkspaceXML (std::ostream &out, const std::string &workspace_id) const
void writeWorkspacesXML (std::ostream &out) const
bool writeWorkspaceLimitedConfigXML (std::ostream &out, const std::string &workspace_id) const
bool hasWorkspace (const std::string &workspace_id) const
bool creationAllowed (xmlNodePtr permission_config_ptr, xmlNodePtr config_ptr) const
bool updateAllowed (xmlNodePtr permission_config_ptr, const std::string &id, xmlNodePtr config_ptr) const
bool removalAllowed (xmlNodePtr permission_config_ptr, const std::string &id) const
bool accessAllowed (xmlNodePtr permission_config_ptr, const std::string &reactor_id) const
std::string getPermissionType (void) const
 returns the type attribute used for an XML Permission node pertaining to Reactors
void send (const std::string &reactor_id, EventPtr &e)
template<typename F>
boost::signals::connection subscribe (const std::string &reactor_id, const std::string &signal_id, F f)
void query (const std::string &reactor_id, std::ostream &out, const Reactor::QueryBranches &branches, const Reactor::QueryParams &qp)
boost::uint64_t getTotalOperations (void) const
boost::uint64_t getEventsIn (const std::string &reactor_id) const
boost::uint64_t getEventsOut (const std::string &reactor_id) const
std::size_t getEventsQueued (void) const
 returns the number of events queued in ReactionScheduler
bool isRunning (const std::string &reactor_id) const
template<typename WorkFunction>
void post (WorkFunction work_func)
boost::uint32_t getNumThreads (void) const
 returns the number of threads currently in use
void setNumThreads (const boost::uint32_t n)
 sets the number of threads used to route and process Events
bool getMultithreadBranches (void) const
 returns the value of the "multithreaded branches" setting
void setMultithreadBranches (bool b)
 sets the value of the "multithreaded branches" setting
bool isRunning (void) const
 returns true if the ReactionEngine is running

Static Public Member Functions

static xmlNodePtr createReactorConfig (const char *buf, std::size_t len)
static xmlNodePtr createConnectionConfig (const char *buf, std::size_t len)

Classes

class  AddConnectionConfigException
 exception thrown if there is an error adding a Connection element to the config file More...
class  AddWorkspaceConfigException
 exception thrown if there is an error adding a Workspace element to the config file More...
class  BadConnectionConfigException
 exception thrown if the configuration info for a new connection is invalid More...
class  BadConnectionTypeException
 exception thrown if the config file includes a connection with a bad or missing type More...
class  BadWorkspaceConfigException
 exception thrown if the configuration info for a new Workspace is invalid More...
class  ConnectionNotFoundException
 exception thrown if we are unable to find a connection with the same identifier More...
class  EmptyConnectionIdException
 exception thrown if the config file contains a Reactor connection with a missing identifier More...
class  EmptyFromException
 exception thrown if the config file includes a connection with a missing From element More...
class  EmptyToException
 exception thrown if the config file includes a connection with a missing To element More...
struct  ReactorConnection
 data type used to keep track of (internal) Reactor connections
class  ReactorNotFoundException
 exception thrown if we are unable to find a Reactor with the same identifier More...
class  RemoveConnectionConfigException
 exception thrown if there is an error removing a Connection from the config file More...
class  RemoveNonEmptyWorkspaceException
 exception thrown when an attempt is made to remove a Workspace with Reactors in it More...
class  SetWorkspaceConfigException
 exception thrown if there is an error modifying a Workspace node More...
struct  TempConnection
 data type used to keep track of temporary reactor connections (i.e. feeds)
class  UpdateConfigOptionException
 exception thrown if there is an error updating a configuration option More...
class  WorkspaceNotFoundException
 exception thrown if we are unable to find a Workspace with the specified identifier More...


Constructor & Destructor Documentation

pion::platform::ReactionEngine::ReactionEngine ( VocabularyManager vocab_mgr,
CodecFactory codec_factory,
ProtocolFactory protocol_factory,
DatabaseManager database_mgr 
)

constructs a new ReactionEngine object

Parameters:
vocab_mgr the global manager of Vocabularies
codec_factory the global factory that manages Codecs
database_mgr the global manager of Databases

Definition at line 51 of file ReactionEngine.cpp.

References pion::platform::PluginConfig< PluginType >::registerForUpdates(), pion::PionScheduler::setLogger(), pion::platform::ConfigManager::setLogger(), pion::PionScheduler::setNumThreads(), updateCodecs(), updateDatabases(), and updateProtocols().


Member Function Documentation

bool pion::platform::ReactionEngine::accessAllowed ( xmlNodePtr  permission_config_ptr,
const std::string &  reactor_id 
) const [virtual]

determines whether a User has permission to use a Reactor

Parameters:
permission_config_ptr the Permission node of type "Reactors" from the User's configuration
reactor_id unique identifier associated with an existing Reactor
Returns:
true if the User has permission

Reimplemented from pion::platform::ConfigManager.

Definition at line 1233 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByContent(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::Reactor::getWorkspace(), and pion::platform::PluginConfig< PluginType >::m_plugins.

std::string pion::platform::ReactionEngine::addReactor ( const xmlNodePtr  config_ptr  ) 

adds a new managed Reactor

Parameters:
config_ptr pointer to a list of XML nodes containing Reactor configuration parameters (must include a Plugin type)
Returns:
std::string the new Reactor's unique identifier

Definition at line 276 of file ReactionEngine.cpp.

Referenced by pion::plugins::ConfigService::operator()().

std::string pion::platform::ReactionEngine::addReactorConnection ( const xmlNodePtr  config_ptr  ) 

connects the output of one Reactor to the input of another Reactor

Parameters:
config_ptr pointer to a list of XML nodes including <From> and <To>
Returns:
std::string unique identifier associated with the new Reactor connection

Definition at line 535 of file ReactionEngine.cpp.

References addReactorConnection(), and pion::platform::ConfigManager::getConfigOption().

std::string pion::platform::ReactionEngine::addReactorConnection ( const std::string &  from_id,
const std::string &  to_id 
)

connects the output of one Reactor to the input of another Reactor

Parameters:
from_id unique identifier associated with the Reactor events come from
to_id unique identifier associated with the Reactor events go to
Returns:
std::string unique identifier associated with the new Reactor connection

Definition at line 478 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::createUUID(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_mutex, and pion::platform::ConfigManager::saveConfigFile().

Referenced by addReactorConnection(), and pion::plugins::ConfigService::operator()().

Reactor * pion::platform::ReactionEngine::addTempConnectionIn ( const std::string &  reactor_id,
const std::string &  connection_id,
const std::string &  connection_info,
boost::function0< void >  removed_handler 
)

registers a temporary connection that sends Events to a Reactor (not saved to config). This should be used VERY carefully since the Reactor may be removed by another thread, invalidating the pointer that is returned to the caller. Make sure that that the pointer is not used after the removed_handler has been called (this will be triggered before it is invalidated).

Parameters:
reactor_id unique identifier associated with the Reactor events come from
connection_id unique identifier associated with the output connection
connection_info descriptive information for the temporary connection
removed_handler function handler called if the Reactor is removed
Returns:
Reactor* pointer to the Reactor that Events should be sent into

Definition at line 332 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_mutex, and pion::platform::PluginConfig< PluginType >::m_plugins.

Referenced by pion::plugins::FeedReader::start().

void pion::platform::ReactionEngine::addTempConnectionOut ( const std::string &  reactor_id,
const std::string &  connection_id,
const std::string &  connection_info,
Reactor::EventHandler  connection_handler 
)

temporarily connects an Event handler to the output of a Reactor (not saved to config). Note that the connection_handler will be sent a null EventPtr object as a notification that the Reactor is being removed.

Parameters:
reactor_id unique identifier associated with the Reactor events come from
connection_id unique identifier associated with the output connection
connection_info descriptive information for the temporary connection
connection_handler function handler to which Events will be sent

Definition at line 357 of file ReactionEngine.cpp.

References pion::platform::Reactor::addConnection(), pion::platform::ConfigManager::configIsOpen(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_mutex, and pion::platform::PluginConfig< PluginType >::m_plugins.

Referenced by pion::plugins::FeedWriter::start().

std::string pion::platform::ReactionEngine::addWorkspace ( const char *  content_buf,
std::size_t  content_length 
)

adds a Reactor Workspace

Parameters:
content_buf pointer to buffer containing XML config for the Workspace
content_length size of the content buffer, in bytes
Returns:
std::string unique identifier associated with the new Reactor Workspace

Definition at line 674 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::createUUID(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::ConfigManager::saveConfigFile(), setWorkspaceConfig(), and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::clearReactorStats ( const std::string &  reactor_id  ) 

clears the statistic counters for a Reactor

Parameters:
reactor_id the identifier for the Reactor to be cleared

Definition at line 125 of file ReactionEngine.cpp.

References pion::platform::Reactor::clearStats(), pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_plugins, and pion::PluginManager< PLUGIN_TYPE >::run().

static xmlNodePtr pion::platform::ReactionEngine::createConnectionConfig ( const char *  buf,
std::size_t  len 
) [inline, static]

uses a memory buffer to generate XML configuration data for a Reactor connection

Parameters:
buf pointer to a memory buffer containing configuration data
len number of bytes available in the memory buffer
Returns:
xmlNodePtr XML configuration list for the Reactor connection

Definition at line 498 of file ReactionEngine.hpp.

References pion::platform::ConfigManager::createResourceConfig().

static xmlNodePtr pion::platform::ReactionEngine::createReactorConfig ( const char *  buf,
std::size_t  len 
) [inline, static]

uses a memory buffer to generate XML configuration data for a Reactor

Parameters:
buf pointer to a memory buffer containing configuration data
len number of bytes available in the memory buffer
Returns:
xmlNodePtr XML configuration list for the Reactor

Definition at line 486 of file ReactionEngine.hpp.

References pion::platform::ConfigManager::createResourceConfig(), and pion::platform::Reactor::REACTOR_ELEMENT_NAME.

bool pion::platform::ReactionEngine::creationAllowed ( xmlNodePtr  permission_config_ptr,
xmlNodePtr  config_ptr 
) const [virtual]

determines whether a User has permission to create a Reactor, Connection or Workspace

Parameters:
permission_config_ptr the Permission node of type "Reactors" from the User's configuration
config_ptr pointer to the new configuration; if null, returns true only if the User has unrestricted Reactor permission
Returns:
true if the User has permission

Reimplemented from pion::platform::ConfigManager.

Definition at line 1086 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByContent(), pion::platform::ConfigManager::findConfigNodeByName(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::ConfigManager::getConfigOption(), pion::platform::Reactor::getWorkspace(), pion::platform::PluginConfig< PluginType >::m_plugins, pion::platform::ConfigManager::PLUGIN_ELEMENT_NAME, and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

boost::uint64_t pion::platform::ReactionEngine::getEventsIn ( const std::string &  reactor_id  )  const [inline]

returns the total number of Events received by a Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
Returns:
boost::uint64_t number of Events received

Definition at line 570 of file ReactionEngine.hpp.

References pion::platform::Reactor::getEventsIn().

Referenced by PionPlatformUnitTest::checkReactorEventsIn().

boost::uint64_t pion::platform::ReactionEngine::getEventsOut ( const std::string &  reactor_id  )  const [inline]

returns the total number of Events delivered by a Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
Returns:
boost::uint64_t number of Events delivered

Definition at line 580 of file ReactionEngine.hpp.

References pion::platform::Reactor::getEventsOut().

Referenced by PionPlatformUnitTest::checkReactorEventsOut().

boost::uint64_t pion::platform::ReactionEngine::getTotalOperations ( void   )  const [inline]

returns the total number operations performed by all managed Reactors

Returns:
boost::uint64_t number of operations performed

Definition at line 560 of file ReactionEngine.hpp.

References pion::platform::Reactor::getEventsIn().

Referenced by writeStatsXML().

bool pion::platform::ReactionEngine::hasWorkspace ( const std::string &  workspace_id  )  const

checks to see if a Workspace with the specified ID exists

Parameters:
workspace_id unique identifier associated with a Workspace
Returns:
bool whether the Workspace was found

Definition at line 1018 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

Referenced by pion::plugins::ConfigService::operator()(), removalAllowed(), removeReactorsFromWorkspace(), and updateAllowed().

bool pion::platform::ReactionEngine::isRunning ( const std::string &  reactor_id  )  const [inline]

returns the running status of a Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
Returns:
bool true if the Reactor is running

Definition at line 593 of file ReactionEngine.hpp.

References pion::platform::Reactor::isRunning().

template<typename WorkFunction>
void pion::platform::ReactionEngine::post ( WorkFunction  work_func  )  [inline]

schedules work to be performed by one of the pooled threads

Parameters:
work_func work function to be executed

Definition at line 606 of file ReactionEngine.hpp.

Referenced by pion::plugins::FeedWriter::writeEvent().

void pion::platform::ReactionEngine::query ( const std::string &  reactor_id,
std::ostream &  out,
const Reactor::QueryBranches branches,
const Reactor::QueryParams qp 
) [inline]

use a Reactor to handle an HTTP query (from QueryService)

Parameters:
reactor_id unique identifier associated with the Reactor
out the ostream to write the statistics info into
branches URI stem path branches for the HTTP request
qp query parameters or pairs passed in the HTTP request

Definition at line 541 of file ReactionEngine.hpp.

References pion::platform::Reactor::query().

bool pion::platform::ReactionEngine::removalAllowed ( xmlNodePtr  permission_config_ptr,
const std::string &  id 
) const [virtual]

determines whether a User has permission to remove a Reactor, Connection or Workspace

Parameters:
permission_config_ptr the Permission node of type "Reactors" from the User's configuration
id unique identifier associated with an existing Reactor, Connection or Workspace
Returns:
true if the User has permission

Reimplemented from pion::platform::ConfigManager.

Definition at line 1179 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByContent(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::Reactor::getWorkspace(), pion::platform::PluginConfig< PluginType >::hasPlugin(), hasWorkspace(), and pion::platform::PluginConfig< PluginType >::m_plugins.

void pion::platform::ReactionEngine::removeReactor ( const std::string &  reactor_id  ) 

removes a managed Reactor

Parameters:
reactor_id unique identifier associated with the Reactor

Definition at line 281 of file ReactionEngine.cpp.

References pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::Reactor::isRunning(), pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::PluginConfig< PluginType >::m_plugins, and stopReactor().

Referenced by pion::plugins::ConfigService::operator()(), and removeReactorsFromWorkspace().

void pion::platform::ReactionEngine::removeReactorConnection ( const std::string &  connection_id  ) 

removes an existing connection between Reactors

Parameters:
connection_id unique identifier associated with the Reactor connection

Definition at line 576 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::m_logger, and pion::platform::PluginConfig< PluginType >::m_mutex.

void pion::platform::ReactionEngine::removeReactorConnection ( const std::string &  from_id,
const std::string &  to_id 
)

removes an existing connection between Reactors

Parameters:
from_id unique identifier associated with the Reactor events come from
to_id unique identifier associated with the Reactor events go to

Definition at line 551 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::m_logger, and pion::platform::PluginConfig< PluginType >::m_mutex.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::removeReactorsFromWorkspace ( const std::string &  workspace_id  ) 

removes all the Reactors in a Workspace

Parameters:
workspace_id unique identifier associated with the Workspace

Definition at line 710 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::getConfigOption(), pion::platform::ConfigManager::getNodeId(), hasWorkspace(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::Reactor::REACTOR_ELEMENT_NAME, removeReactor(), and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::removeTempConnection ( const std::string &  connection_id  ) 

removes a temporary connection between Reactors (does not change config)

Parameters:
connection_id unique identifier associated with the temporary connection

Definition at line 385 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::m_logger, and pion::platform::PluginConfig< PluginType >::m_mutex.

Referenced by pion::plugins::FeedReader::start(), and pion::plugins::MonitorWriter::stop().

void pion::platform::ReactionEngine::removeWorkspace ( const std::string &  workspace_id  ) 

removes an empty Reactor Workspace

Parameters:
workspace_id unique identifier associated with the Workspace

Definition at line 746 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::getConfigOption(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::ConfigManager::m_logger, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::platform::ConfigManager::saveConfigFile(), and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::send ( const std::string &  reactor_id,
EventPtr e 
) [inline]

schedules an Event to be processed by a Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
e pointer to the Event that will be processed

Definition at line 508 of file ReactionEngine.hpp.

Referenced by PionPlatformUnitTest::feedFileToReactor().

void pion::platform::ReactionEngine::setReactorConfig ( const std::string &  reactor_id,
const xmlNodePtr  config_ptr 
)

sets configuration parameters for a managed Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
config_ptr pointer to a list of XML nodes containing Reactor configuration parameters

Definition at line 210 of file ReactionEngine.cpp.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::setReactorLocation ( const std::string &  reactor_id,
const xmlNodePtr  config_ptr 
)

sets configuration parameters specifying location in the UI for a managed Reactor

Parameters:
reactor_id unique identifier associated with the Reactor
config_ptr pointer to a list of XML nodes containing Reactor configuration parameters

Definition at line 221 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::getConfigOption(), pion::platform::ConfigManager::getNodeId(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::platform::ConfigManager::updateConfigOption(), pion::platform::Reactor::X_COORDINATE_ELEMENT_NAME, and pion::platform::Reactor::Y_COORDINATE_ELEMENT_NAME.

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::setWorkspaceConfig ( const std::string &  workspace_id,
const char *  content_buf,
std::size_t  content_length 
)

sets configuration parameters for a Workspace

Parameters:
workspace_id unique identifier associated with the Workspace
content_buf pointer to buffer containing XML config for the Workspace
content_length size of the content buffer, in bytes

Definition at line 791 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::ConfigManager::saveConfigFile(), and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

Referenced by addWorkspace(), and pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::startReactor ( const std::string &  reactor_id  ) 

starts Event processing for a collection Reactor

Parameters:
reactor_id unique identifier associated with the Reactor

Definition at line 424 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::getNodeId(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_plugins, pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::PluginManager< PLUGIN_TYPE >::run(), pion::platform::Reactor::RUNNING_ELEMENT_NAME, pion::platform::ConfigManager::saveConfigFile(), pion::platform::Reactor::start(), and pion::platform::ConfigManager::updateConfigOption().

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::stopReactor ( const std::string &  reactor_id  ) 

stops Event processing for a collection Reactor

Parameters:
reactor_id unique identifier associated with the Reactor

Definition at line 451 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::configIsOpen(), pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::getConfigFile(), pion::platform::ConfigManager::getNodeId(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_plugins, pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::PluginManager< PLUGIN_TYPE >::run(), pion::platform::Reactor::RUNNING_ELEMENT_NAME, pion::platform::ConfigManager::saveConfigFile(), pion::platform::Reactor::stop(), and pion::platform::ConfigManager::updateConfigOption().

Referenced by pion::plugins::ConfigService::operator()(), and removeReactor().

template<typename F>
boost::signals::connection pion::platform::ReactionEngine::subscribe ( const std::string &  reactor_id,
const std::string &  signal_id,
f 
) [inline]

subscribes an external observer to a Reactor's named signal

Parameters:
reactor_id unique identifier associated with the Reactor
signal_id unique identifier for the signal
f callback function or slot to connect to the signal - signature must be (const std::string& reactor_id, const std::string& signal_id, void*)
Returns:
boost::signals::connection object that represents the new slot connection

Definition at line 526 of file ReactionEngine.hpp.

References pion::platform::Reactor::subscribe().

bool pion::platform::ReactionEngine::updateAllowed ( xmlNodePtr  permission_config_ptr,
const std::string &  id,
xmlNodePtr  config_ptr 
) const [virtual]

determines whether a User has permission to update a Reactor or Workspace

Parameters:
permission_config_ptr the Permission node of type "Reactors" from the User's configuration
id unique identifier associated with an existing Reactor or Workspace
config_ptr pointer to the new configuration; if null, returns true only if any configuration would be allowed
Returns:
true if the User has permission

Reimplemented from pion::platform::ConfigManager.

Definition at line 1142 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByContent(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::ConfigManager::getConfigOption(), pion::platform::Reactor::getWorkspace(), pion::platform::PluginConfig< PluginType >::hasPlugin(), hasWorkspace(), pion::platform::PluginConfig< PluginType >::m_plugins, and pion::platform::Reactor::WORKSPACE_ELEMENT_NAME.

void pion::platform::ReactionEngine::writeConnectionsXML ( std::ostream &  out  )  const [inline]

writes connection info for all Reactors to an output stream (as XML)

Parameters:
out the ostream to write the connection info into

Definition at line 393 of file ReactionEngine.hpp.

void pion::platform::ReactionEngine::writeConnectionsXML ( std::ostream &  out,
const std::string &  only_id 
) const

writes info for particular connections to an output stream (as XML)

Parameters:
out the ostream to write the connection info into
only_id include only connections where either the connection ID or the ID of one of its endpoints matches this unique identifier, or include all connections if empty

Definition at line 922 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::ConfigManager::writeBeginPionConfigXML(), and pion::platform::ConfigManager::writeEndPionConfigXML().

Referenced by pion::plugins::ConfigService::operator()(), and pion::plugins::FeedHandler::sendResponse().

void pion::platform::ReactionEngine::writeStatsXML ( std::ostream &  out,
const std::string &  reactor_id = "",
const bool  details = false 
)

writes Reactor statistics to an output stream (as XML)

Parameters:
out the ostream to write the statistics into
reactor_id include only the Reactor that matches this unique identifier, or include all Reactors if empty
details if true, then display detailed stats using the reactor's query service

Definition at line 869 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByName(), pion::PluginManager< PLUGIN_TYPE >::get(), getEventsQueued(), pion::platform::ConfigManager::getNodeId(), getTotalOperations(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::PluginConfig< PluginType >::m_plugins, pion::platform::Reactor::query(), pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::platform::ConfigManager::writeBeginPionStatsXML(), pion::platform::ConfigManager::writeEndPionStatsXML(), and pion::platform::Reactor::writeStatsXML().

Referenced by pion::plugins::ConfigService::operator()().

bool pion::platform::ReactionEngine::writeWorkspaceLimitedConfigXML ( std::ostream &  out,
const std::string &  workspace_id 
) const

writes all info in the entire configuration that pertains to a particular Reactor Workspace to an output stream (as XML)

Parameters:
out the ostream to write the Workspace info into
workspace_id the unique of the Workspace requested
Returns:
bool whether the Workspace was found

Definition at line 1027 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::findConfigNodeByName(), pion::PluginManager< PLUGIN_TYPE >::get(), pion::platform::ConfigManager::getConfigOption(), pion::platform::Reactor::getWorkspace(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::PluginConfig< PluginType >::m_plugins, pion::platform::Reactor::REACTOR_ELEMENT_NAME, pion::platform::Reactor::WORKSPACE_ELEMENT_NAME, pion::platform::ConfigManager::writeBeginPionConfigXML(), pion::platform::ConfigManager::writeConfigXML(), and pion::platform::ConfigManager::writeEndPionConfigXML().

Referenced by pion::plugins::ConfigService::operator()().

void pion::platform::ReactionEngine::writeWorkspacesXML ( std::ostream &  out  )  const

writes Workspace info for all Reactor Workspaces to an output stream (as XML)

Parameters:
out the ostream to write the Workspaces info into

Definition at line 1003 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByName(), pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::Reactor::WORKSPACE_ELEMENT_NAME, pion::platform::ConfigManager::writeBeginPionConfigXML(), pion::platform::ConfigManager::writeConfigXML(), and pion::platform::ConfigManager::writeEndPionConfigXML().

Referenced by pion::plugins::ConfigService::operator()().

bool pion::platform::ReactionEngine::writeWorkspaceXML ( std::ostream &  out,
const std::string &  workspace_id 
) const

writes info for a particular Reactor Workspace to an output stream (as XML)

Parameters:
out the ostream to write the Workspace info into
workspace_id the unique of the Workspace requested
Returns:
bool whether the Workspace was found

Definition at line 983 of file ReactionEngine.cpp.

References pion::platform::ConfigManager::findConfigNodeByAttr(), pion::platform::ConfigManager::ID_ATTRIBUTE_NAME, pion::platform::ConfigManager::m_config_node_ptr, pion::platform::PluginConfig< PluginType >::m_mutex, pion::platform::Reactor::WORKSPACE_ELEMENT_NAME, pion::platform::ConfigManager::writeBeginPionConfigXML(), pion::platform::ConfigManager::writeConfigXML(), and pion::platform::ConfigManager::writeEndPionConfigXML().

Referenced by pion::plugins::ConfigService::operator()().


The documentation for this class was generated from the following files:
Generated on Wed Apr 13 16:38:36 2011 for pion-platform by  doxygen 1.4.7