activemq-cpp-3.6.0
activemq::transport::TransportRegistry Class Reference

Registry of all Transport Factories that are available to the client at runtime. More...

#include <src/main/activemq/transport/TransportRegistry.h>

Public Member Functions

virtual ~TransportRegistry ()
TransportFactoryfindFactory (const std::string &name) const
 Gets a Registered TransportFactory from the Registry and returns it if there is not a registered format factory with the given name an exception is thrown.
void registerFactory (const std::string &name, TransportFactory *factory)
 Registers a new TransportFactory with this Registry.
void unregisterFactory (const std::string &name)
 Unregisters the Factory with the given name and deletes that instance of the Factory.
void unregisterAllFactories ()
 Removes all Factories and deletes the instances of the Factory objects.
std::vector< std::string > getTransportNames () const
 Retrieves a list of the names of all the Registered Transport's in this Registry.

Static Public Member Functions

static TransportRegistrygetInstance ()
 Gets the single instance of the TransportRegistry.

Friends

class activemq::library::ActiveMQCPP

Detailed Description

Registry of all Transport Factories that are available to the client at runtime.

New Transport's must have a factory registered here before a connection attempt is made.

Since
3.0

Constructor & Destructor Documentation

virtual activemq::transport::TransportRegistry::~TransportRegistry ( )
virtual

Member Function Documentation

TransportFactory* activemq::transport::TransportRegistry::findFactory ( const std::string &  name) const

Gets a Registered TransportFactory from the Registry and returns it if there is not a registered format factory with the given name an exception is thrown.

Parameters
nameThe name of the Factory to find in the Registry.
Returns
the Factory registered under the given name.
Exceptions
NoSuchElementExceptionif no factory is registered with that name.
static TransportRegistry& activemq::transport::TransportRegistry::getInstance ( )
static

Gets the single instance of the TransportRegistry.

Returns
reference to the single instance of this Registry
std::vector<std::string> activemq::transport::TransportRegistry::getTransportNames ( ) const

Retrieves a list of the names of all the Registered Transport's in this Registry.

Returns
stl vector of strings with all the Transport names registered.
void activemq::transport::TransportRegistry::registerFactory ( const std::string &  name,
TransportFactory factory 
)

Registers a new TransportFactory with this Registry.

If a Factory with the given name is already registered it is overwritten with the new one. Once a factory is added to the Registry its lifetime is controlled by the Registry, it will be deleted once the Registry has been deleted.

Parameters
nameThe name of the new Factory to register.
factoryThe new Factory to add to the Registry.
Exceptions
IllegalArgumentExceptionis name is the empty string.
NullPointerExceptionif the Factory is Null.
void activemq::transport::TransportRegistry::unregisterAllFactories ( )

Removes all Factories and deletes the instances of the Factory objects.

void activemq::transport::TransportRegistry::unregisterFactory ( const std::string &  name)

Unregisters the Factory with the given name and deletes that instance of the Factory.

Parameters
nameName of the Factory to unregister and destroy

Friends And Related Function Documentation

friend class activemq::library::ActiveMQCPP
friend

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