|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.jlab.coda.cMsg.cMsgCallbackThread
public class cMsgCallbackThread
This class is used to run a message callback in its own thread. The thread is self-starting and waits to execute the callback. All it needs is a notify.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
cMsgCallbackThread(cMsgCallbackInterface callback,
java.lang.Object arg,
java.lang.String domain,
java.lang.String subject,
java.lang.String type)
Constructor. |
Method Summary | |
---|---|
void |
dieNow(boolean callInterrupt)
This method kills this thread as soon as possible. |
java.lang.Object |
getArg()
Gets the user argument. |
cMsgCallbackInterface |
getCallback()
Gets the callback object. |
int |
getCount()
Gets the number of identical subscriptions. |
int |
getCueSize()
Gets the number of messages in the cue. |
long |
getMsgCount()
Gets the number of messages passed to the callback. |
void |
run()
This method is executed as a thread which runs the callback method |
void |
sendMessage(cMsgMessageFull message)
Put message on a cue of messages waiting to be taken by the callback. |
void |
setCount(int count)
Sets the number of identical subscriptions. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public cMsgCallbackThread(cMsgCallbackInterface callback, java.lang.Object arg, java.lang.String domain, java.lang.String subject, java.lang.String type)
callback
- callback to be run when message arrivesarg
- user-supplied argument for callbackdomain
- subject
- type
- Method Detail |
---|
public void dieNow(boolean callInterrupt)
callInterrupt
- if true interrupt is called on callback thread,
else interrupt is not called.public long getMsgCount()
public int getCueSize()
public cMsgCallbackInterface getCallback()
public java.lang.Object getArg()
public int getCount()
public void setCount(int count)
count
- the number of identical subscriptionspublic void sendMessage(cMsgMessageFull message)
message
- message to be passed to callbackpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |