public class JZtxtcmdThread extends JZtxtcmdThreadData implements java.lang.Runnable
JZtxtcmdExecuter#scriptThread. Any user created thread (in a script)
creates an instance of this.| Modifier and Type | Class and Description |
|---|---|
static class |
JZtxtcmdThread.MsgItem
Item inside the message queues.
|
| Modifier and Type | Field and Description |
|---|---|
private MessageQueue<JZtxtcmdThread.MsgItem> |
cmd1
A queue for input and a queue for output data.
|
private JZtxtcmdExecuter.ExecuteLevel |
executeLevel
Used only for starting the thread.
|
private MessageQueue<JZtxtcmdThread.MsgItem> |
msg1
A queue for input and a queue for output data.
|
(package private) char |
state
State of thread execution. i-init, r-run, y-finished.
|
private JZtxtcmdScript.ThreadBlock |
statement
Used only for starting the thread.
|
static java.lang.String |
sVersion
Version, history and license.
|
error, excColumn, exception, excLine, excSrcfile, excStatement, version| Constructor and Description |
|---|
JZtxtcmdThread() |
| Modifier and Type | Method and Description |
|---|---|
JZtxtcmdThread.MsgItem |
awaitcmd(int timeout)
Waits for a command which can be sent by another thread using
sendcmd(String, Object) |
java.lang.Object |
awaitmsg(int timeout) |
protected void |
clear() |
boolean |
join(int time)
Waits for finishing the thread.
|
void |
run() |
void |
sendcmd(java.lang.String cmd,
java.lang.Object data)
Sends a command from another thread to this thread.
|
void |
sendmsg(java.lang.String cmd,
java.lang.Object data) |
protected void |
startThread(java.lang.String name,
JZtxtcmdExecuter.ExecuteLevel startLevel,
JZtxtcmdScript.ThreadBlock statementArg) |
char |
state()
State of thread execution.
|
public static final java.lang.String sVersion
sendcmd(String, Object) etc. uses 2 arguments, internally JZtxtcmdThread.MsgItem is stored.
JZtxtcmdExecuter: JZcmdThread and ThreadData.
Both class are joined.
private JZtxtcmdExecuter.ExecuteLevel executeLevel
private JZtxtcmdScript.ThreadBlock statement
char state
private MessageQueue<JZtxtcmdThread.MsgItem> msg1
#sendcmd(Object) etc.private MessageQueue<JZtxtcmdThread.MsgItem> cmd1
#sendcmd(Object) etc.protected void startThread(java.lang.String name,
JZtxtcmdExecuter.ExecuteLevel startLevel,
JZtxtcmdScript.ThreadBlock statementArg)
public void run()
run in interface java.lang.Runnableprotected void clear()
public char state()
public void sendcmd(java.lang.String cmd,
java.lang.Object data)
cmd - the string given command.data - Any data.public JZtxtcmdThread.MsgItem awaitcmd(int timeout)
sendcmd(String, Object)timeout - milliseconds for wait, use 0 for wait forever.public void sendmsg(java.lang.String cmd,
java.lang.Object data)
public java.lang.Object awaitmsg(int timeout)
public boolean join(int time)
time - timeout for waiting