This class is used to construct a Queue Reader. More...
Public Member Functions | |
bool | canMaintainPriority () |
Returns whether the queue has a priority order where only 1 consumer at a time will consume from the queue More... | |
nEventListener | getListener () |
Returns the current event listener being used More... | |
int | getPeekBatchSize () |
Returns the current peek batch size, used only for synchronous queue readers More... | |
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 () | |
Default constructor, useful for creating a standard synchronous queue reader. More... | |
nQueueReaderContext (string selector) | |
This constructor supports a standard synchronous queue reader with the message selector applied. More... | |
nQueueReaderContext (nEventListener aListener) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
nQueueReaderContext (nEventListener aListener, int windowSize) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
nQueueReaderContext (nEventListener aListener, string selector) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
nQueueReaderContext (nEventListener aListener, string selector, int windowSize) | |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored. More... | |
void | setListener (nEventListener listener) |
Sets the current listener. More... | |
void | setMaintainPriority (bool flag) |
Sets whether the reader will observe the priority ordering where only 1 consumer will actively consume events More... | |
void | setPeekBatchSize (int peekBatchSize) |
Sets the current peek batch size, used only for synchronous queue readers. More... | |
void | setSelector (string selector) |
Sets the message selector. More... | |
void | setValidator (nMessageValidator validator) |
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 | ( | ) |
Default constructor, useful for creating a standard synchronous queue reader.
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext | ( | 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 |
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext | ( | nEventListener | aListener | ) |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.
When applied as an asynchronous queue reader the window size will default to 1.
aListener | Asynchronous callback object |
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext | ( | nEventListener | aListener, |
int | windowSize | ||
) |
This constructor supports an asynchronous queue reader, if applied to a synchronous queue reader the listener is ignored.
aListener | 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 | ( | nEventListener | aListener, |
string | selector | ||
) |
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.
aListener | Asynchronous callback object |
selector | Message selector to be applied to the events prior to being delivered to the client |
com.pcbsys.nirvana.client.nQueueReaderContext.nQueueReaderContext | ( | nEventListener | aListener, |
string | selector, | ||
int | windowSize | ||
) |
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.
aListener | 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 |
bool com.pcbsys.nirvana.client.nQueueReaderContext.canMaintainPriority | ( | ) |
Returns whether the queue has a priority order where only 1 consumer at a time will consume from the queue
nEventListener com.pcbsys.nirvana.client.nQueueReaderContext.getListener | ( | ) |
Returns the current event listener being used
int com.pcbsys.nirvana.client.nQueueReaderContext.getPeekBatchSize | ( | ) |
Returns the current peek batch size, used only for synchronous queue readers
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 | listener | ) |
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.
listener | Event listener. |
void com.pcbsys.nirvana.client.nQueueReaderContext.setMaintainPriority | ( | bool | flag | ) |
Sets whether the reader will observe the priority ordering where only 1 consumer will actively consume events
flag | true / false to set the priority flag |
void com.pcbsys.nirvana.client.nQueueReaderContext.setPeekBatchSize | ( | int | peekBatchSize | ) |
Sets the current peek batch size, used only for synchronous queue readers.
peekBatchSize | the number of events to fetch when doing a pop |
void com.pcbsys.nirvana.client.nQueueReaderContext.setSelector | ( | 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 | validator | ) |
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.
validator | 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 |