public class QueueTransport extends Thread implements TransportIntf
QueueReader is used to remove messages from the
internal memory queue.
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
protected Queue |
queue |
protected boolean |
runLoop |
protected ServicesIntf |
service |
protected QueueStats |
stats |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYCATEGROY_ADAPTER, CATEGROY_APP, CATEGROY_DB_CON, CATEGROY_DB_POOL, CATEGROY_ENGINE, CATEGROY_MODULE, CATEGROY_POOL_MGR, CATEGROY_QUEUE, CATEGROY_THREAD_MGR, CATEGROY_WORKER, COMMAND_DEREGISTER_KEY, COMMAND_PAUSE, COMMAND_REGISTER_KEY, COMMAND_RESTART, COMMAND_SHUTDOWN, COMMAND_START, COMMAND_STOP, FLAG_FALSE, FLAG_TRUE, PARAM_JVM_STR, PARAM_JVMID_STR, PARAM_SERVERNAME_STR, PARAM_SERVICEACTIVE_STR, PARAM_SERVICECATAGORY_STR, PARAM_SERVICENAME_STR, PARAM_SERVICERUNNING_STR, TYPE_CLUSTER, TYPE_DISPLAY_STR, TYPE_EVENT, TYPE_JVM, TYPE_JVM_STR, TYPE_MAX, TYPE_SERVER, TYPE_SERVICE| Constructor and Description |
|---|
QueueTransport() |
QueueTransport(Queue aQueue,
int aHashCode,
ServicesIntf aService)
Constructor - Creates a new QueueReader
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInProcess()
This method will add 1 to the total message in process.
|
void |
addMsg(MessageIntf aMsg)
Add a new message to the queue
|
void |
addTotalErrorNumber()
This method will add 1 to the total error number.
|
void |
addTotalMsgNumber()
This method will add 1 to the total message received.
|
void |
addTotalProcessed()
This method will add 1 to the total number of message processed.
|
void |
addTransport(TransportIntf aTransport)
Synchronized - Will add a new Writer to the Queue
|
void |
close()
Will stop this reader from reading the queue
|
void |
deRegister(FrameworkIntf aFramework)
This method is called to de-register the service
|
void |
doEventMessage(MessageIntf aData)
This method is called to send the service event message
|
void |
doMessage(MessageIntf aData)
This method is called to send the service status message
|
long |
getInProcess()
This method will return the Total Number of Messages in process.
|
String |
getJvmId() |
FrameworkIntf |
getJvmService() |
MessageIntf |
getMsg()
Get a new message from the queue (No Wait)
|
MessageIntf |
getMsgNoWait()
Get a new message from the queue (No Wait)
|
MessageIntf |
getStats()
This method is called to send a snapshot of performance data
|
long |
getTotalErrorNumber()
This method will return the Total Number of Errors processed.
|
long |
getTotalMsgNumber()
This method will return the Total Number of Messages received.
|
long |
getTotalProcessed()
This method will return the Total Number of Messages processed.
|
String |
getTransportName()
Returns the Queue Reference Name
|
int |
getUserHashCode()
Returns the users object hash code
|
void |
init(MessageIntf Msg) |
void |
initMessage(MessageIntf aData) |
void |
initTransport(Map<String,String> aDataMap,
ServicesIntf aService)
This method will initialize the internal parameters.
|
boolean |
isActive() |
boolean |
isListener() |
boolean |
isReader() |
boolean |
isRunning() |
boolean |
isWriter() |
boolean |
processMsg(MessageIntf aMsg) |
boolean |
processMsgListner(MessageIntf aMsg) |
MessageIntf |
readMsg()
This method will remove the next message from the queue, if one
does not exist then wait for next message.
|
MessageIntf |
readMsg(long aTimeout)
This method will remove the next message from the queue, if one
does not exist then wait for next message or until specified timeout.
|
void |
register(FrameworkIntf aFramework)
This method is called to register the service
|
void |
register(TransportIntf aListener) |
void |
removeTransport()
Will remove the this reader from the queue reader list
|
void |
removeTransport(TransportIntf aTransport)
Synchronized - Will remove a Reader from the Queue
|
void |
resetTotals() |
void |
run()
This method is called by the thread an will run until the close method
is called.
|
void |
setActive(boolean aFlag) |
void |
setListener(boolean aFlag) |
void |
setReader(boolean aFlag) |
void |
setRunning(boolean aFlag) |
void |
setWriter(boolean aFlag) |
void |
shutdown()
Called to shut down the reader.
|
int |
size()
Returns the total number of messages left in the queue
|
void |
subtractInProcess()
This method will add 1 to the total message in process.
|
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, yieldequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetNameprotected Queue queue
protected QueueStats stats
protected ServicesIntf service
protected boolean runLoop
public QueueTransport()
public QueueTransport(Queue aQueue, int aHashCode, ServicesIntf aService)
aQueue - a Queue valueaHashCode - an int valueaService - QueueReaderIntf QueueReader Objectpublic void initTransport(Map<String,String> aDataMap, ServicesIntf aService)
TransportIntfinitTransport in interface TransportIntfaDataMap - dataaService - servicepublic int getUserHashCode()
getUserHashCode in interface TransportIntfpublic void close()
close in interface TransportIntfpublic void addMsg(MessageIntf aMsg)
addMsg in interface TransportIntfaMsg - Object New Queue Messagepublic MessageIntf readMsg() throws Exception
readMsg in interface TransportIntfExceptionpublic MessageIntf readMsg(long aTimeout) throws Exception
readMsg in interface TransportIntfExceptionpublic MessageIntf getMsg() throws Exception
getMsg in interface TransportIntfException - expublic MessageIntf getMsgNoWait() throws Exception
getMsgNoWait in interface TransportIntfException - expublic void removeTransport()
public int size()
size in interface TransportIntfpublic void run()
public void register(TransportIntf aListener) throws Exception
Exceptionpublic boolean processMsg(MessageIntf aMsg)
public void shutdown()
throws Exception
Exception - expublic boolean isReader()
isReader in interface TransportIntfpublic void setReader(boolean aFlag)
setReader in interface TransportIntfpublic boolean isWriter()
isWriter in interface TransportIntfpublic void setWriter(boolean aFlag)
setWriter in interface TransportIntfpublic boolean isListener()
isListener in interface TransportIntfpublic void setListener(boolean aFlag)
setListener in interface TransportIntfpublic void register(FrameworkIntf aFramework)
FrameworkIntfregister in interface FrameworkIntfaFramework - ServerBaseIntf Service Objectpublic void deRegister(FrameworkIntf aFramework)
FrameworkIntfdeRegister in interface FrameworkIntfaFramework - ServerBaseIntf Service Objectpublic void initMessage(MessageIntf aData) throws Exception
initMessage in interface FrameworkIntfExceptionpublic void doMessage(MessageIntf aData)
FrameworkIntfdoMessage in interface FrameworkIntfaData - ServiceDataintf Service Datapublic void doEventMessage(MessageIntf aData)
FrameworkIntfdoEventMessage in interface FrameworkIntfaData - ServiceDataintf Service Datapublic MessageIntf getStats()
FrameworkIntfgetStats in interface FrameworkIntfpublic FrameworkIntf getJvmService()
getJvmService in interface FrameworkIntfpublic String getJvmId()
getJvmId in interface FrameworkIntfpublic boolean isRunning()
isRunning in interface FrameworkIntfpublic void setRunning(boolean aFlag)
setRunning in interface FrameworkIntfpublic boolean isActive()
isActive in interface FrameworkIntfpublic void setActive(boolean aFlag)
setActive in interface FrameworkIntfpublic long getTotalErrorNumber()
FrameworkIntfgetTotalErrorNumber in interface FrameworkIntfpublic void addTotalErrorNumber()
FrameworkIntfaddTotalErrorNumber in interface FrameworkIntfpublic long getTotalProcessed()
FrameworkIntfgetTotalProcessed in interface FrameworkIntfpublic void addTotalProcessed()
FrameworkIntfaddTotalProcessed in interface FrameworkIntfpublic long getInProcess()
FrameworkIntfgetInProcess in interface FrameworkIntfpublic void addInProcess()
FrameworkIntfaddInProcess in interface FrameworkIntfpublic void subtractInProcess()
FrameworkIntfsubtractInProcess in interface FrameworkIntfpublic long getTotalMsgNumber()
FrameworkIntfgetTotalMsgNumber in interface FrameworkIntfpublic void addTotalMsgNumber()
FrameworkIntfaddTotalMsgNumber in interface FrameworkIntfpublic void resetTotals()
resetTotals in interface FrameworkIntfpublic void init(MessageIntf Msg)
init in interface TransportIntfpublic String getTransportName()
TransportIntfgetTransportName in interface TransportIntfpublic void addTransport(TransportIntf aTransport)
TransportIntfaddTransport in interface TransportIntfaTransport - QueueWriter New queue writer objectpublic void removeTransport(TransportIntf aTransport)
TransportIntfremoveTransport in interface TransportIntfaTransport - QueueReader Queue reader objectpublic boolean processMsgListner(MessageIntf aMsg)
processMsgListner in interface TransportIntfCopyright © 2020. All rights reserved.