- com
- pcbsys
- nirvana
- client
- nQueueReaderContext
This class is used to construct a Queue Reader. More...
#include <nQueueReaderContext.h>
Inherits CountableObject.
Public Member Functions | |
nEventListener * | getListener () |
Returns the current event listener being used. More... | |
int | getPeekBatchSize () |
Retrieves the current peek batch size. More... | |
std::string | getSelector () |
Returns the current selector that this context was constructed with, could be null. More... | |
nMessageValidator * | getValidator () |
Retrieves the current message validator. More... | |
int | getWindow () |
Retrieves the current window size. More... | |
nQueueReaderContext (void) | |
Default constructor, useful for creating a standard synchronous queue reader. | |
nQueueReaderContext (nEventListener *pListener, const std::string &selector, int windowSize=0) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
nQueueReaderContext (nEventListener *pListener, int windowSize=0) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
nQueueReaderContext (const std::string &selector) | |
This constructor supports a standard synchronous queue reader with the message selector applied. More... | |
void | setListener (nEventListener *pListener) |
Sets the current listener. More... | |
void | setPeekBatchSize (int peekBatchSize) |
Sets the peek batch size, this is hte number of events a single call to the server will return. More... | |
void | setSelector (const std::string &selector) |
Sets the message selector. More... | |
void | setValidator (nMessageValidator *pValidator) |
Sets the current message validator. More... | |
void | setWindow (int window) |
Sets the window size. More... | |
This class is used to construct a Queue Reader.
com::pcbsys::nirvana::client::nQueueReaderContext::nQueueReaderContext | ( | nEventListener * | pListener, |
const std::string & | selector, | ||
int | windowSize = 0 |
||
) |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.
The message selector will be applied to all events prior to being delivered to the client from the server.
*pListener | Asynchronous callback object |
selector | Message selector to be applied to the events prior to being delivered to the client |
windowSize | Number of events that the server will deliver prior to expecting a commit or rollback |
com::pcbsys::nirvana::client::nQueueReaderContext::nQueueReaderContext | ( | nEventListener * | pListener, |
int | windowSize = 0 |
||
) |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.
*pListener | Asynchronous callback object |
windowSize | Number of events that the server will deliver prior to expecting a commit or rollback |
com::pcbsys::nirvana::client::nQueueReaderContext::nQueueReaderContext | ( | const std::string & | selector | ) |
This constructor supports a standard synchronous queue reader with the message selector applied.
selector | Message selector to be applied to the events prior to being delivered to the client |
nEventListener* com::pcbsys::nirvana::client::nQueueReaderContext::getListener | ( | ) |
Returns the current event listener being used.
int com::pcbsys::nirvana::client::nQueueReaderContext::getPeekBatchSize | ( | ) |
Retrieves the current peek batch size.
std::string com::pcbsys::nirvana::client::nQueueReaderContext::getSelector | ( | ) |
Returns the current selector that this context was constructed with, could be null.
nMessageValidator* com::pcbsys::nirvana::client::nQueueReaderContext::getValidator | ( | ) |
Retrieves the current message validator.
This could be null.
int com::pcbsys::nirvana::client::nQueueReaderContext::getWindow | ( | ) |
Retrieves the current window size.
This is the number of events the server will send prior to expecting an rollback
or a commit
. No more events will be sent when this number is reached an no call is made.
void com::pcbsys::nirvana::client::nQueueReaderContext::setListener | ( | nEventListener * | pListener | ) |
Sets the current listener.
This has no effect if the reader has been created prior to calling this method. The reader will need to be destroyed and recreated.
*pListener | Event listener. |
void com::pcbsys::nirvana::client::nQueueReaderContext::setPeekBatchSize | ( | int | peekBatchSize | ) |
Sets the peek batch size, this is hte number of events a single call to the server will return.
peekBatchSize | the peek batch size to use |
void com::pcbsys::nirvana::client::nQueueReaderContext::setSelector | ( | const std::string & | selector | ) |
Sets the message selector.
If the reader has already been created this method does nothing. If the reader is an asynchronous queue reader then the existing reader must be destroyed and recreated before this selector will take effect else the next pop
will take this into account
selector | a Message selector |
void com::pcbsys::nirvana::client::nQueueReaderContext::setValidator | ( | nMessageValidator * | pValidator | ) |
Sets the current message validator.
It has no effect if the reader is an asynchronous queue reader and the reader will need to be destroyed and recreated prior to this taking effect. If the reader is an synchronous queue reader the next event popped will use the message validator.
*pValidator | The message validator to use. |
void com::pcbsys::nirvana::client::nQueueReaderContext::setWindow | ( | int | window | ) |
Sets the window size.
This function has no effect on synchronous readers and if the asynchronous reader is constructed prior to this method then it will not take effect until the reader is destroyed and recreated.
window | the window size to use |