Apama
10.2.0.3
|
A class allowing a plug-in to report status values to the host. More...
#include <sag_connectivity_plugins.hpp>
Classes | |
class | StatusItem |
A class that can be used to efficiently update the value associated with a single status key. More... | |
Public Types | |
typedef std::unique_ptr < StatusItem > | item_ptr |
Unique pointer to a StatusItem. More... | |
Public Member Functions | |
item_ptr | createStatusItem (const std::string &key, const std::string &initialValue) |
Creates a StatusItem instance that can be used to report status for a given key. More... | |
item_ptr | createStatusItem (const std::string &key, int64_t initialValue) |
Creates a StatusItem instance that can be used to report status for a given key, using an integral initial value. More... | |
void | setStatus (const map_t &statusmap) |
Set multiple related string status values at the same time (atomically). More... | |
Static Public Member Functions | |
static const char * | STATUS_ONLINE () |
Returns a constant that should be used as the status value when a component is online, operational, connected, and ready to handles messages. More... | |
static const char * | STATUS_STARTING () |
Returns a constant that should be used as the status value when a component is still starting, i.e. More... | |
static const char * | STATUS_FAILED () |
Returns a constant that should be used as the status value when a component is not currently operational due to an error condition. More... | |
A class allowing a plug-in to report status values to the host.
Ensure that no methods are called on this object after the plug-in has been shutdown.
This object is NOT thread-safe, so please use additional locking if it is necessary to call its methods from multiple threads. However typically this will not be required, as usually all status items are created in a plug-in's constructor and each would be accessed subsequently from just one thread (e.g. hostwards status items on a thread handling hostwards messages and transportwards status items on a thread handling transportwards items).
typedef std::unique_ptr<StatusItem> com::softwareag::connectivity::StatusReporter::item_ptr |
Unique pointer to a StatusItem.
|
inline |
Creates a StatusItem instance that can be used to report status for a given key.
It is an error to call this more than once for a given key.
The returned object must be deleted as part of plug-in destruction; the typical pattern for this is to store the unique_ptr as a member of the plug-in.
key | a unique key that will identify this status item to the host. Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesTowardsHost". |
initialValue | the initial value for this item. |
|
inline |
Creates a StatusItem instance that can be used to report status for a given key, using an integral initial value.
It is an error to call this more than once for a given key.
The returned object must be deleted as part of plug-in destruction; the typical pattern for this is to store the unique_ptr as a member of the plug-in.
key | a unique key that will identify this status item to the host. Typically this will include the chainId and plugin name, for example chainId+"."+pluginName+".messagesTowardsHost". |
initialValue | the initial value for this item. |
|
inline |
Set multiple related string status values at the same time (atomically).
The more efficient setStatus(const std::string &key, const std::string &value) should be used instead unless there is a need to change multiple values atomically.
Any status keys set using this method will be automatically removed when the plug-in instance is shutdown.
|
inlinestatic |
Returns a constant that should be used as the status value when a component is not currently operational due to an error condition.
|
inlinestatic |
Returns a constant that should be used as the status value when a component is online, operational, connected, and ready to handles messages.
|
inlinestatic |
Returns a constant that should be used as the status value when a component is still starting, i.e.
not yet online, but not failed.