RSB
0.9.6
|
Factory for RSB user-level domain objects for communication patterns. More...
#include <Factory.h>
Public Member Functions | |
DEPRECATED (static Factory &getInstance()) | |
virtual | ~Factory () |
template<class DataType > | |
Informer< DataType >::Ptr | createInformer (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig(), const std::string &dataType=detail::TypeName< DataType >()()) |
Creates and returns a new Informer that publishes Event s under the Scope scope. More... | |
InformerBasePtr | createInformerBase (const Scope &scope, const std::string &dataType="", const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates and returns a new Informer that publishes Event s under the Scope scope. More... | |
ListenerPtr | createListener (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates a new listener for the specified scope. More... | |
ReaderPtr | createReader (const Scope &scope, const ParticipantConfig &config=getFactory().getDefaultParticipantConfig()) |
Creates a new Reader object for the specified scope. More... | |
ServicePtr | createService (const Scope &scope) |
Creates a Service instance operating on the given scope. More... | |
patterns::ServerPtr | createServer (const Scope &scope, const ParticipantConfig &listenerConfig=getFactory().getDefaultParticipantConfig(), const ParticipantConfig &informerConfig=getFactory().getDefaultParticipantConfig()) |
Creates a Server object that exposes methods under the scope scope. More... | |
patterns::RemoteServerPtr | createRemoteServer (const Scope &scope, const ParticipantConfig &listenerConfig=getFactory().getDefaultParticipantConfig(), const ParticipantConfig &informerConfig=getFactory().getDefaultParticipantConfig()) |
Creates a RemoteServer object for the server at scope scope. More... | |
ParticipantConfig | getDefaultParticipantConfig () const |
Returns the default configuration for new participants. More... | |
void | setDefaultParticipantConfig (const ParticipantConfig &config) |
Sets the default config for participants that will be used for every new participant that is created after this call. More... | |
rsc::plugins::ManagerPtr | getPluginManager () const |
Returns the plugin manager instance used by the RSB core. More... | |
Private Member Functions | |
Factory () | |
Singleton constructor. More... | |
std::vector < transport::OutConnectorPtr > | createOutConnectors (const ParticipantConfig &config) |
std::vector < transport::InPullConnectorPtr > | createInPullConnectors (const ParticipantConfig &config) |
std::vector < transport::InPushConnectorPtr > | createInPushConnectors (const ParticipantConfig &config) |
void | configureSubsystem (rsc::config::OptionHandler &handler, const std::string &environmentVariablePrefix="RSB_") |
Static Private Member Functions | |
static Factory & | getInstanceBase () |
Private Attributes | |
rsc::logging::LoggerPtr | logger |
rsc::plugins::ManagerPtr | pluginManager |
ParticipantConfig | defaultConfig |
Always acquire configMutex before reading or writing the config. More... | |
boost::recursive_mutex | configMutex |
Friends | |
class | rsc::patterns::Singleton< Factory > |
Factory & | getFactory () |
Returns a factory for client-level RSB objects. More... | |
Factory for RSB user-level domain objects for communication patterns.
|
virtual |
Definition at line 196 of file Factory.cpp.
|
private |
Singleton constructor.
Definition at line 97 of file Factory.cpp.
References rsb::ParticipantConfig::addTransport(), defaultConfig, rsb::transport::ConnectorFactory< Interface >::getConnectorInfos(), rsb::transport::getInPullFactory(), rsb::transport::getInPushFactory(), rsb::transport::getOutFactory(), rsb::ParticipantConfig::getTransports(), logger, rsb::ParticipantConfig::mutableTransport(), pluginManager, rsb::converter::registerDefaultConverters(), rsb::eventprocessing::registerDefaultEventProcessingStrategies(), rsb::transport::registerDefaultTransports(), and rsb::ParticipantConfig::Transport::setEnabled().
|
private |
|
inline |
Creates and returns a new Informer that publishes Event s under the Scope scope.
DataType | the C++ data type this informer publishes |
scope | the scope of the informer |
config | the configuration for the informer to use, defaults to the general config held in this factory. |
dataType | A string representation of the type of data sent via the new Informer |
RSBError | If the requested informer cannot be created. |
Definition at line 99 of file Factory.h.
Referenced by rsb::createInformer(), rsb::patterns::RemoteServer::getMethodSet(), and rsb::patterns::Server<>::registerMethod().
InformerBasePtr rsb::Factory::createInformerBase | ( | const Scope & | scope, |
const std::string & | dataType = "" , |
||
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates and returns a new Informer that publishes Event s under the Scope scope.
scope | the scope of the informer |
dataType | A string representation of the type of data sent via the new Informer. |
config | The configuration for the informer to use, defaults to the general config held in this factory. |
RSBError | If the requested informer cannot be created. |
Definition at line 199 of file Factory.cpp.
References createOutConnectors().
Referenced by rsb::crateInformerBase().
|
private |
Definition at line 245 of file Factory.cpp.
References rsb::transport::getInPullFactory(), rsb::ParticipantConfig::getTransports(), and logger.
Referenced by createReader().
|
private |
Definition at line 279 of file Factory.cpp.
References rsb::transport::getInPushFactory(), rsb::ParticipantConfig::getTransports(), and logger.
Referenced by createListener().
ListenerPtr rsb::Factory::createListener | ( | const Scope & | scope, |
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a new listener for the specified scope.
scope | the scope of the new listener |
config | the configuration for the LISTENER to use, defaults to the general config held in this factory.f |
Definition at line 206 of file Factory.cpp.
References createInPushConnectors().
Referenced by rsb::createListener(), rsb::patterns::RemoteServer::getMethodSet(), and rsb::patterns::Server<>::registerMethod().
|
private |
Definition at line 313 of file Factory.cpp.
References rsb::transport::getOutFactory(), rsb::ParticipantConfig::getTransports(), and logger.
Referenced by createInformerBase().
ReaderPtr rsb::Factory::createReader | ( | const Scope & | scope, |
const ParticipantConfig & | config = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a new Reader object for the specified scope.
Reader objects receive event via a pull-style interface by calls to Reader::read.
scope | the scope of the new receiver |
RSBError | when the requested connection cannot be established. |
Definition at line 211 of file Factory.cpp.
References createInPullConnectors().
Referenced by rsb::createReader().
patterns::RemoteServerPtr rsb::Factory::createRemoteServer | ( | const Scope & | scope, |
const ParticipantConfig & | listenerConfig = getFactory().getDefaultParticipantConfig() , |
||
const ParticipantConfig & | informerConfig = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a RemoteServer object for the server at scope scope.
scope | The scope at which the remote server object exposes itself. |
listenerConfig | configuration to use for all reply listeners |
informerConfig | configuration to use for all request informers |
Definition at line 223 of file Factory.cpp.
Referenced by rsb::createRemoteServer().
patterns::ServerPtr rsb::Factory::createServer | ( | const Scope & | scope, |
const ParticipantConfig & | listenerConfig = getFactory().getDefaultParticipantConfig() , |
||
const ParticipantConfig & | informerConfig = getFactory().getDefaultParticipantConfig() |
||
) |
Creates a Server object that exposes methods under the scope scope.
scope | The scope under which the new server exposes its methods. |
listenerConfig | configuration to use for all request listeners |
informerConfig | configuration to use for all reply informers |
Definition at line 216 of file Factory.cpp.
Referenced by rsb::createServer().
ServicePtr rsb::Factory::createService | ( | const Scope & | scope | ) |
Creates a Service instance operating on the given scope.
scope | parent-scope of the new service |
Definition at line 240 of file Factory.cpp.
Referenced by rsb::createService().
rsb::Factory::DEPRECATED | ( | static Factory & | getInstance() | ) |
ParticipantConfig rsb::Factory::getDefaultParticipantConfig | ( | ) | const |
Returns the default configuration for new participants.
Definition at line 230 of file Factory.cpp.
References configMutex, and defaultConfig.
|
staticprivate |
Definition at line 93 of file Factory.cpp.
rsc::plugins::ManagerPtr rsb::Factory::getPluginManager | ( | ) | const |
Returns the plugin manager instance used by the RSB core.
Definition at line 346 of file Factory.cpp.
References pluginManager.
void rsb::Factory::setDefaultParticipantConfig | ( | const ParticipantConfig & | config | ) |
Sets the default config for participants that will be used for every new participant that is created after this call.
config | new config |
Definition at line 235 of file Factory.cpp.
References configMutex, and defaultConfig.
|
friend |
Returns a factory for client-level RSB objects.
Definition at line 89 of file Factory.cpp.
|
mutableprivate |
Definition at line 237 of file Factory.h.
Referenced by getDefaultParticipantConfig(), and setDefaultParticipantConfig().
|
private |
Always acquire configMutex before reading or writing the config.
Definition at line 236 of file Factory.h.
Referenced by Factory(), getDefaultParticipantConfig(), and setDefaultParticipantConfig().
|
private |
Definition at line 229 of file Factory.h.
Referenced by createInPullConnectors(), createInPushConnectors(), createOutConnectors(), and Factory().
|
private |
Definition at line 231 of file Factory.h.
Referenced by Factory(), and getPluginManager().