public class ERPQueueReader
extends java.lang.Thread
Modifier and Type | Class and Description |
---|---|
private class |
ERPQueueReader.KKEngines
Class used to transport the admin and App engines
|
private class |
ERPQueueReader.MsgCount
Class to keep track of the message count
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
defaultStoreId
Default storeId - comes from the setting in the Incoming Message Processor servlet definition
in the web.xml
|
private AdminEngineCacheMgrIf |
engMgr
KK Engine Mgr to manage engines for different stores
|
private org.apache.commons.logging.Log |
log
The
Log instance for this class. |
private java.lang.String |
logBasePathKO
Base path for the log for messages that have failed
|
private java.lang.String |
logBasePathOK
Base path for the log for messages that have passed
|
private boolean |
loop
Variable to decide whether to keep looping
|
private long |
mqInitialPauseMillis
Initial Sleep time in millis - this is to allow the MQ Service to start in another webapp
|
private com.konakart.mqif.MqMgrIf |
mqMgr
MQMgr to read the queue
|
private com.konakart.appif.MqOptionsIf |
mqOptions
MQ Options object for reading the queue
|
private long |
mqReadFrequencyMillis
Sleep time in millis
|
private AdminServletMgrIf |
servletMgr
Manager started by the servlet used to set off this thread
|
Constructor and Description |
---|
ERPQueueReader() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultStoreId() |
AdminEngineCacheMgrIf |
getEngMgr() |
private ERPQueueReader.KKEngines |
getKKEngines(java.lang.String storeId)
Utility method to return Admin and App engines from a cache
|
java.lang.String |
getLogBasePathKO() |
java.lang.String |
getLogBasePathOK() |
private java.lang.String |
getLogName(boolean passed)
Returns the name of a log for a message
|
long |
getMqInitialPauseMillis() |
com.konakart.mqif.MqMgrIf |
getMqMgr() |
com.konakart.appif.MqOptionsIf |
getMqOptions() |
long |
getMqReadFrequencyMillis() |
AdminServletMgrIf |
getServletMgr() |
private void |
msgReturnlog(boolean ret,
AdminImportMgrIf mgr,
java.lang.StringBuffer logSB,
com.konakart.erp.jaxb.IOMsgBase msg,
ERPQueueReader.MsgCount msgCount)
Utility method called after the return of a message processing call
|
private void |
processMsg(com.konakart.appif.MqResponseIf mqresp)
Method used to process the messages read from MQ
|
void |
run()
This thread runs forever.
|
private void |
sendExceptionEmail(ERPQueueReader.KKEngines engines,
java.lang.String logName)
Send an email with the log as an attachment
|
void |
setDefaultStoreId(java.lang.String defaultStoreId) |
void |
setEngMgr(AdminEngineCacheMgrIf engMgr) |
void |
setLogBasePathKO(java.lang.String logBasePathKO) |
void |
setLogBasePathOK(java.lang.String logBasePathOK) |
void |
setMqInitialPauseMillis(long mqInitialPauseMillis) |
void |
setMqMgr(com.konakart.mqif.MqMgrIf mqMgr) |
void |
setMqOptions(com.konakart.appif.MqOptionsIf mqOptions) |
void |
setMqReadFrequencyMillis(long mqReadFrequencyMillis) |
void |
setServletMgr(AdminServletMgrIf servletMgr) |
void |
stopLooping()
Stop the current thread from looping
|
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, yield
private org.apache.commons.logging.Log log
Log
instance for this class.private long mqReadFrequencyMillis
private long mqInitialPauseMillis
private com.konakart.mqif.MqMgrIf mqMgr
private AdminEngineCacheMgrIf engMgr
private AdminServletMgrIf servletMgr
private com.konakart.appif.MqOptionsIf mqOptions
private java.lang.String logBasePathOK
private java.lang.String logBasePathKO
private boolean loop
private java.lang.String defaultStoreId
public void stopLooping()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private void processMsg(com.konakart.appif.MqResponseIf mqresp) throws java.io.IOException
mqresp
- the mqrespjava.io.IOException
- an unexpected IOException exceptionprivate void sendExceptionEmail(ERPQueueReader.KKEngines engines, java.lang.String logName) throws java.lang.Exception
engines
- the engineslogName
- the logNamejava.lang.Exception
- an unexpected exceptionprivate void msgReturnlog(boolean ret, AdminImportMgrIf mgr, java.lang.StringBuffer logSB, com.konakart.erp.jaxb.IOMsgBase msg, ERPQueueReader.MsgCount msgCount) throws java.io.IOException, com.konakart.app.KKException
ret
- the retmgr
- the mgrlogSB
- the logSBmsg
- the msgmsgCount
- the msgCountjava.io.IOException
- an unexpected IOException exceptioncom.konakart.app.KKException
- an unexpected KKException exceptionprivate ERPQueueReader.KKEngines getKKEngines(java.lang.String storeId) throws java.lang.Exception
storeId
- the storeIdjava.lang.Exception
- an unexpected exceptionprivate java.lang.String getLogName(boolean passed)
passed
- the passedpublic com.konakart.mqif.MqMgrIf getMqMgr()
public void setMqMgr(com.konakart.mqif.MqMgrIf mqMgr)
mqMgr
- the mqMgr to setpublic AdminEngineCacheMgrIf getEngMgr()
public void setEngMgr(AdminEngineCacheMgrIf engMgr)
engMgr
- the engMgr to setpublic com.konakart.appif.MqOptionsIf getMqOptions()
public void setMqOptions(com.konakart.appif.MqOptionsIf mqOptions)
mqOptions
- the mqOptions to setpublic java.lang.String getLogBasePathOK()
public void setLogBasePathOK(java.lang.String logBasePathOK)
logBasePathOK
- the logBasePathOK to setpublic java.lang.String getLogBasePathKO()
public void setLogBasePathKO(java.lang.String logBasePathKO)
logBasePathKO
- the logBasePathKO to setpublic long getMqReadFrequencyMillis()
public void setMqReadFrequencyMillis(long mqReadFrequencyMillis)
mqReadFrequencyMillis
- the mqReadFrequencyMillis to setpublic AdminServletMgrIf getServletMgr()
public void setServletMgr(AdminServletMgrIf servletMgr)
servletMgr
- the servletMgr to setpublic java.lang.String getDefaultStoreId()
public void setDefaultStoreId(java.lang.String defaultStoreId)
defaultStoreId
- the defaultStoreId to setpublic long getMqInitialPauseMillis()
public void setMqInitialPauseMillis(long mqInitialPauseMillis)
mqInitialPauseMillis
- the mqInitialPauseMillis to setCopyright © 2018 DS Data Systems UK Ltd.