Queue allows applications to dispatch events in order with multiple threads using a single MamaDispatcher for each queue. More...
#include <MamaQueue.h>
Public Member Functions | |
MamaQueue (void) | |
MamaQueue (mamaQueue cQueue) | |
virtual | ~MamaQueue (void) |
virtual void | create (mamaBridge bridgeImpl) |
Create a queue. More... | |
virtual void | create (mamaBridge bridgeImpl, void *nativeQueue) |
virtual void | dispatch () |
Dispatch message. More... | |
virtual void | timedDispatch (uint64_t timeout) |
Dispatch messages until timeout (see release notes for details) More... | |
virtual void | dispatchEvent () |
Dispatch a single event from the specified queue. More... | |
virtual void | enqueueEvent (MamaQueueEventCallback *callback, void *closure) |
Add a user event to a queue. More... | |
virtual void | enqueueEvent (MamaQueueEventCallback &callback, void *closure) |
virtual void | stopDispatch () |
stopDispatch the queue. More... | |
virtual size_t | getEventCount () |
Returns the number of events currently on the queue. More... | |
virtual void | setEnqueueCallback (MamaQueueEnqueueCallback *cb, void *closure) |
Set a callback which will be invoked as each event is added to the underlying event queue. More... | |
virtual void | setQueueMonitorCallback (MamaQueueMonitorCallback *cb, void *closure) |
Register an object to receive callbacks for monitoring the behaviour of the MamaQueue. More... | |
virtual void | setHighWatermark (size_t highWatermark) |
Specify a high watermark for events on the queue. More... | |
virtual size_t | getHighWatermark (void) const |
Return the high water mark as set via setHighWaterMark() More... | |
virtual void | setLowWatermark (size_t lowWatermark) |
Set the low watermark. More... | |
virtual size_t | getLowWatermark (void) const |
Return the low water mark as set via setLowWaterMark() More... | |
virtual void | setQueueName (const char *name) |
Associate a name identifier with the event queue. More... | |
virtual const char * | getQueueName () const |
Retrieve the string name identifier for the queue as specified from a call to setQueueName() . More... | |
virtual const char * | getQueueBridgeName () const |
Retrieve the string name identifier for the queue's bridge. More... | |
virtual void | destroy () |
Destroy a queue. More... | |
virtual void | setClosure (void *closure) |
virtual void * | getClosure () |
virtual void | destroyTimedWait (long timeout) |
Destroy a queue. More... | |
virtual void | destroyWait () |
Destroy a queue. More... | |
mamaQueue | getCValue () |
Access to C types for implementation of related classes. More... | |
const mamaQueue | getCValue () const |
void | setCValue (mamaQueue cQueue) |
This can only be set once and only if the c value is not already set - E.g. More... | |
Public Attributes | |
MamaQueueImpl * | mPimpl |
Queue allows applications to dispatch events in order with multiple threads using a single MamaDispatcher for each queue.
Wombat::MamaQueue::MamaQueue | ( | void | ) |
Wombat::MamaQueue::MamaQueue | ( | mamaQueue | cQueue) |
|
virtual |
|
virtual |
Create a queue.
Queues allow applications to dispatch events in order with multiple threads using a single mamaDispatcher for each queue.
Callers should call delete queue when done.
|
virtual |
|
virtual |
Dispatch message.
Blocks and dispatches messages until unblock is called.
|
virtual |
Dispatch messages until timeout (see release notes for details)
|
virtual |
Dispatch a single event from the specified queue.
If there is no event on the queue simply return and do nothing
|
virtual |
Add a user event to a queue.
callback | Instance of the MamaQueueEventCallback interface. MamaQueueEventCallback.onEvent() will be invoked when the event fires. |
closure | Optional user supplied arbitrary closure data which will be passed back in the MamaQueueEventCallback.onEvent) callback |
MamaException | Not currently implemented for pure Java API. |
|
virtual |
|
virtual |
stopDispatch the queue.
|
virtual |
Returns the number of events currently on the queue.
|
virtual |
Set a callback which will be invoked as each event is added to the underlying event queue.
cb | Pointer to an instance of MamaQueueEnqueueCallback |
closure | Arbitrary user supplied data. Passed back to onEventEnqueue() for each event enqueued. |
|
virtual |
Register an object to receive callbacks for monitoring the behaviour of the MamaQueue.
cb | Reference to the object which will receive callbacks. |
closure | User supplied data which will be returned as the callbacks are invoked. |
|
virtual |
Specify a high watermark for events on the queue.
The behaviour for setting this value varies depending on the underlying middleware.
LBM: LBM uses an unbounded event queue. Setting this values allows users of the API to receive a callback if the value is exceeded. (See mamaQueue_setQueueMonitorCallback() for setting queue related callbacks) the default behaviour is for the queue to grow unbounded without notifications. The high watermark for LBM can be set for all queues at once by setting the mama.lbm.eventqueuemonitor.queue_size_warning property for the API. Calls to this function will override the value specified in mama.properties.
RV: This will set a queue limit policy of TIBRVQUEUE_DISCARD_FIRST whereby the oldest events in the queue are discarded first. The discard amount will be set with a value of 1. i.e. events will be dropped from the queue one at a time. The default behaviour is an unlimited queue which does not discard events.
|
virtual |
Return the high water mark as set via setHighWaterMark()
|
virtual |
Set the low watermark.
Only supported for Wombat TCP middleware.
lowWatermark | The low water mark. |
|
virtual |
Return the low water mark as set via setLowWaterMark()
|
virtual |
Associate a name identifier with the event queue.
This will be used in queue related logging statements. The string is copied by the API.
name | The string name identifier for the queue. |
|
virtual |
Retrieve the string name identifier for the queue as specified from a call to setQueueName()
.
If a name has not been specified via a call tosetQueueName()
the queue will assume a default name of "NO_NAME"
|
virtual |
Retrieve the string name identifier for the queue's bridge.
|
virtual |
Destroy a queue.
Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed.
queue | The queue. |
MamaStatus | with a code of MAMA_STATUS_QUEUE_OPEN_OBJECTS if there are still objects open against the queue. |
|
virtual |
|
virtual |
|
virtual |
Destroy a queue.
Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block for the specified time or until all of the objects have been destroyed and will then destroy the queue.
timeout | The time to block for in ms. |
MamaStatus | with a code of MAMA_STATUS_TIMEOUT if the time elapsed. |
|
virtual |
Destroy a queue.
Note that the queue can only be destroyed if all of the objects created on it, (timers, subscriptions etc), have been destroyed. This function will block until all of the objects have been destroyed and will then destroy the queue.
mamaQueue Wombat::MamaQueue::getCValue | ( | ) |
Access to C types for implementation of related classes.
const mamaQueue Wombat::MamaQueue::getCValue | ( | ) | const |
void Wombat::MamaQueue::setCValue | ( | mamaQueue | cQueue) |
This can only be set once and only if the c value is not already set - E.g.
from calling create()
MamaQueueImpl* Wombat::MamaQueue::mPimpl |