|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttcl.lang.WrappedCommand
public class WrappedCommand
A Wrapped Command is like the Command struct defined in the C version in the file generic/tclInt.h. It is "wrapped" around a TclJava Command interface reference. We need to wrap Command references so that we can keep track of sticky issues like what namespace the command is defined in without requiring that every implementation of a Command interface provide method to do this. This class also handles command and execution traces. This class is only used in the internal implementation of Jacl.
Field Summary | |
---|---|
Command |
cmd
The actual command interface that is being wrapped |
int |
cmdEpoch
incremented to invalidate any references. |
boolean |
deleted
Means that the command is in the process of being deleted. |
String |
hashKey
A string that stores the name of the command. |
Namespace |
ns
The namespace where the command is located |
HashMap<String,WrappedCommand> |
table
Reference to the table that this command is defined inside. |
Constructor Summary | |
---|---|
WrappedCommand()
|
Method Summary | |
---|---|
boolean |
hasCommandTraces()
|
void |
invoke(Interp interp,
TclObject[] objv)
Call cmd.cmdProc after calling execution traces on this command, and call execution traces after this command exits. |
boolean |
mustCallInvoke(Interp interp)
|
void |
removeAllCommandTraces()
Eliminate all the command traces on thsi command |
String |
toString()
|
void |
traceCommand(CommandTrace trace)
Set a command trace on this command |
TclObject |
traceCommandInfo(Interp interp)
Get a list of all command traces on this command |
void |
traceExecution(ExecutionTrace trace)
Set an execution trace on this command |
TclObject |
traceExecutionInfo(Interp interp)
Get a list of all execution traces on this command |
void |
untraceCommand(int type,
String callbackCmd)
Remove a command trace on this command |
void |
untraceExecution(int type,
String callbackCmd)
Remove an execution trace on this command |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public HashMap<String,WrappedCommand> table
public String hashKey
public Namespace ns
public Command cmd
public boolean deleted
public int cmdEpoch
Constructor Detail |
---|
public WrappedCommand()
Method Detail |
---|
public boolean hasCommandTraces()
public void removeAllCommandTraces()
public void untraceCommand(int type, String callbackCmd) throws TclException
type
- CommandTrace.RENAME or CommandTrace.DELETEcallbackCmd
- callback command to remove
TclException
public void traceCommand(CommandTrace trace) throws TclException
trace
- trace to add to command
TclException
public TclObject traceCommandInfo(Interp interp) throws TclException
interp
- interpreter for error messages
TclException
public void traceExecution(ExecutionTrace trace) throws TclException
trace
- trace to add to command
TclException
public void untraceExecution(int type, String callbackCmd) throws TclException
type
- ExecutionTrace.ENTER, ExecutionTrace.LEAVE,
ExecutionTrace.ENTERSTEP or ExecutionTrace.LEAVESTEPcallbackCmd
- callback command to remove
TclException
public TclObject traceExecutionInfo(Interp interp) throws TclException
interp
- interpreter for error messages
TclException
public final boolean mustCallInvoke(Interp interp)
public void invoke(Interp interp, TclObject[] objv) throws TclException
interp
- The interpreter containing the context for thie command, and
where results are returnedobjv
- argument list for command; objv[0] is the command name itself
TclException
- on any errorspublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |