public class TestCatcher extends Service implements SerialDataListener
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
static ServiceType |
meta |
java.util.concurrent.BlockingQueue<Message> |
msgs
data to hold the incoming messages
|
cfgDir, dnaPool, MESSAGE_RECORDING_FORMAT_BINARY, MESSAGE_RECORDING_FORMAT_XML
Constructor and Description |
---|
TestCatcher(java.lang.String n) |
Modifier and Type | Method and Description |
---|---|
void |
addData(java.lang.String method,
java.lang.Object... parms) |
void |
checkMsg(long timeout,
java.lang.String method,
java.lang.Object... checkParms) |
void |
checkMsg(java.lang.String method) |
void |
checkMsg(java.lang.String method,
java.lang.Object... checkParms) |
void |
clear() |
java.lang.Object |
getData(long timeout) |
static ServiceType |
getMetaData() |
Message |
getMsg(long timeout) |
int |
getMsgCount() |
java.util.concurrent.BlockingQueue<Message> |
getMsgs() |
boolean |
isLocal()
awesome override to simulate remote services - e.g.
|
static void |
main(java.lang.String[] args) |
java.lang.Integer |
onByte(java.lang.Integer b)
some pub/sub interfaces do not use the Message queue to post their data -
but use a callback thread from the other service as an optimization onByte
is one of those methods
|
void |
onConnect(java.lang.String portName) |
void |
onDisconnect(java.lang.String portName) |
Status |
onError(Status error) |
boolean |
preProcessHook(Message msg) |
double |
testDouble(double d) |
java.util.ArrayList<?> |
waitForData(int count) |
java.util.ArrayList<?> |
waitForData(int count,
int timeout) |
java.util.ArrayList<?> |
waitForData(int count,
int timeout,
int pollInterval) |
java.util.concurrent.BlockingQueue<Message> |
waitForMsgs(int count) |
java.util.concurrent.BlockingQueue<Message> |
waitForMsgs(int count,
int timeout) |
addListener, addListener, addTask, addTask, addTask, addTaskOneShot, allowDisplay, allowDisplay, attach, attach, broadcastState, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, detach, detach, echoHeartbeat, error, error, error, getAttached, getCfgDir, getComm, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDna, getDnaString, getHostName, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLastError, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeerKey, getPeerName, getServiceResourceFile, getSimpleName, getTasks, getThisThread, getType, hasError, hasPeers, help, help, in, info, info, invoke, invoke, invoke, invokeOn, isAttached, isAttached, isReady, isRunning, isRuntime, isVirtual, load, load, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preRoutingHook, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeers, releaseService, removeAllListeners, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, setInstanceId, setName, setPeer, setSecurityProvider, setState, setThisThread, setVirtual, sleep, stackToString, startHeartbeat, startPeer, startPeer, startRecording, startService, stopHeartbeat, stopMsgRecording, stopService, subscribe, subscribe, subscribe, toString, unsubscribe, unsubscribe, unsubscribe, updateStats, warn, warn
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
publishStats, updateStats
getName
public static final org.slf4j.Logger log
public transient java.util.concurrent.BlockingQueue<Message> msgs
public static ServiceType meta
public boolean isLocal()
isLocal
in interface Attachable
isLocal
in class Service
public java.lang.Integer onByte(java.lang.Integer b)
onByte
in interface SerialDataListener
public boolean preProcessHook(Message msg)
preProcessHook
in class Service
public void clear()
public java.util.concurrent.BlockingQueue<Message> getMsgs()
public Message getMsg(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object getData(long timeout) throws java.lang.InterruptedException
java.lang.InterruptedException
public java.util.concurrent.BlockingQueue<Message> waitForMsgs(int count) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.concurrent.BlockingQueue<Message> waitForMsgs(int count, int timeout) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.ArrayList<?> waitForData(int count) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.ArrayList<?> waitForData(int count, int timeout) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public java.util.ArrayList<?> waitForData(int count, int timeout, int pollInterval) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public int getMsgCount()
public void onConnect(java.lang.String portName)
onConnect
in interface PortListener
public void onDisconnect(java.lang.String portName)
onDisconnect
in interface PortListener
public void checkMsg(java.lang.String method) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public void checkMsg(java.lang.String method, java.lang.Object... checkParms) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public void checkMsg(long timeout, java.lang.String method, java.lang.Object... checkParms) throws java.lang.InterruptedException, java.io.IOException
java.lang.InterruptedException
java.io.IOException
public void addData(java.lang.String method, java.lang.Object... parms)
public double testDouble(double d)
public static void main(java.lang.String[] args)
public static ServiceType getMetaData()