public class KdbConsumerThread extends Thread
Wraps KdbConsumer in a separate thread
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
private KdbConsumer |
consumer
The underlying consumer object that will listen and notify listeners when messages are received
|
private IKdbConsumerFailedListener |
failureListener |
private static org.slf4j.Logger |
log |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
KdbConsumerThread(KdbProcess server,
KdbDict subscriptionConfig,
IKdbRawDataConsumer rawDataConsumer,
IKdbTableConsumer tableConsumer,
IKdbConsumerFailedListener failureListener) |
KdbConsumerThread(KdbProcess server,
List<String> tables,
IKdbRawDataConsumer rawDataConsumer,
IKdbTableConsumer tableConsumer,
IKdbConsumerFailedListener failureListener)
NOTE: At least one of
IKdbRawDataConsumer or IKdbTableConsumer must be supplied. |
| Modifier and Type | Method and Description |
|---|---|
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final org.slf4j.Logger log
private KdbConsumer consumer
private IKdbConsumerFailedListener failureListener
public KdbConsumerThread(KdbProcess server, List<String> tables, IKdbRawDataConsumer rawDataConsumer, IKdbTableConsumer tableConsumer, IKdbConsumerFailedListener failureListener) throws KdbTargetProcessUnavailableException
NOTE: At least one of IKdbRawDataConsumer or IKdbTableConsumer must be supplied. Both can
also be supplied.
NOTE 2: If a failure listener (IKdbConsumerFailedListener) is supplied and the connection to
the kdb process fails, this will be handled before the exception is thrown.
server - The server to connect and subscribe totables - The list of tables to subscribe torawDataConsumer - Optional class to consume the raw Object's that are received from kdb. Pass null for
no consumertableConsumer - Optional class to consume nicer KdbTable's as received from kdb. Pass null for no
consumerfailureListener - Optional class to be notified if the consumer fails to start up or subscribe. Pass null
for no listenerKdbTargetProcessUnavailableExceptionKdbConsumer.KdbConsumer(KdbProcess, List, IKdbRawDataConsumer, IKdbTableConsumer)public KdbConsumerThread(KdbProcess server, KdbDict subscriptionConfig, IKdbRawDataConsumer rawDataConsumer, IKdbTableConsumer tableConsumer, IKdbConsumerFailedListener failureListener) throws KdbTargetProcessUnavailableException
Copyright © 2017. All rights reserved.