lime.util.console
Class LimeConsole
java.lang.Object
|
+--lime.util.console.LimeConsole
- All Implemented Interfaces:
- lime.util.console.LimeConstants
- public class LimeConsole
- extends java.lang.Object
- implements lime.util.console.LimeConstants
A graphical front-end to a Lime Tuple Space. It allows the user to interact
with the tuple space and write tuples, force engagements, and so on. Useful
for debugging and testing, as well as for learning how Lime works.
A LimeConsole
is associated at creation time to a given Lime
tuple space, that must be already created.
Operations requested through the graphical interface are not directly
invoked by the Lime console. As mentioned in LimeTupleSpace
, this would involve having the AWT thread performing the
operations, which would violate the requirement that only the
ILimeAgent
that created the Lime tuple space is allowed to
access it.
Instead, operations requested by the user are inserted in a queue managed by
the LimeConsole
object. The agent that contains the
LimeConsole
object can only test whether the queue is empty,
using the method isOpQueueEmpty
, or request the execution of
the next operation in the queue, using performQueuedOp
. For an
example of how to write code that leverages off of the
LimeConsole
, see the documentation about the examples.
For instructions about how to use the graphical user interface, please
refer to the Lime console description in the
documentation.
- Version:
- 1.0 alpha
- Author:
- Gian Pietro Picco
- See Also:
LimeConsoleListener
,
LimeTupleSpace
Method Summary |
void |
display(java.lang.String msg)
Display a message on the console. |
LimeTupleSpace |
getLimeTupleSpace()
Return the Lime tuple space associated with this Lime console. |
boolean |
isOpQueueEmpty()
Returns true if the queue of operations is empty,
false otherwise. |
java.lang.String |
performQueuedOp()
Process the first element in the operation queue. |
void |
quit()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_LISTENER
public static final java.lang.String DEFAULT_LISTENER
VERSION
public static final java.lang.String VERSION
WRITE
public static final short WRITE
OUTG
public static final short OUTG
REM_OUTG_ACK
public static final short REM_OUTG_ACK
TAKE
public static final short TAKE
WAIT_TO_TAKE
public static final short WAIT_TO_TAKE
ING
public static final short ING
READ
public static final short READ
WAIT_TO_READ
public static final short WAIT_TO_READ
RDG
public static final short RDG
REACTS_TO
public static final short REACTS_TO
UPON
public static final short UPON
REMOVE_REACTS_TO
public static final short REMOVE_REACTS_TO
REMOVE_UPON
public static final short REMOVE_UPON
INST_REACTS_TO
public static final short INST_REACTS_TO
INST_UPON_LISTENER
public static final short INST_UPON_LISTENER
INST_REM_UPON_LISTENER
public static final short INST_REM_UPON_LISTENER
REMOVE_REM_UPON_LISTENER
public static final short REMOVE_REM_UPON_LISTENER
REM_SYS_TAKE
public static final short REM_SYS_TAKE
REM_SYS_READ
public static final short REM_SYS_READ
REM_ING
public static final short REM_ING
REM_RDG
public static final short REM_RDG
SYS_TAKE
public static final short SYS_TAKE
SYS_READ
public static final short SYS_READ
UPON_EVENT
public static final short UPON_EVENT
SYS_REPLY
public static final short SYS_REPLY
LOCAL_SYS_TAKE
public static final short LOCAL_SYS_TAKE
SET_SHARED
public static final short SET_SHARED
SET_HOST
public static final short SET_HOST
ENGAGE_AGENT
public static final short ENGAGE_AGENT
ENGAGE_HOST
public static final short ENGAGE_HOST
DISENGAGE_AGENT
public static final short DISENGAGE_AGENT
DISENGAGE_HOST
public static final short DISENGAGE_HOST
SHUTDOWN_LIME
public static final short SHUTDOWN_LIME
GO
public static final short GO
SETUP
public static final short SETUP
READY
public static final short READY
START
public static final short START
DATA
public static final short DATA
HOST_BYE
public static final short HOST_BYE
HOST_HELLO
public static final short HOST_HELLO
AGENT_BYE
public static final short AGENT_BYE
AGENT_HELLO
public static final short AGENT_HELLO
HOST_LOCALHOST
public static final short HOST_LOCALHOST
HOST_REMOTE
public static final short HOST_REMOTE
HOST_NOTINSYS
public static final short HOST_NOTINSYS
HOST_UNSPECIFIED
public static final short HOST_UNSPECIFIED
AGENT_LOCALHOST
public static final short AGENT_LOCALHOST
AGENT_REMOTE
public static final short AGENT_REMOTE
AGENT_NOTINSYS
public static final short AGENT_NOTINSYS
AGENT_UNSPECIFIED
public static final short AGENT_UNSPECIFIED
TYPE_TAG
public static final int TYPE_TAG
HOST_TUPLE_HOST_TAG
public static final int HOST_TUPLE_HOST_TAG
HOST_ADDR_TAG
public static final int HOST_ADDR_TAG
AGENT_ID_TAG
public static final int AGENT_ID_TAG
TS_ID_TAG
public static final int TS_ID_TAG
HOST
public static final java.lang.String HOST
AGENT
public static final java.lang.String AGENT
TS
public static final java.lang.String TS
HOST_GONE
public static final java.lang.String HOST_GONE
AGENT_GONE
public static final java.lang.String AGENT_GONE
TS_GONE
public static final java.lang.String TS_GONE
MAX_ROUNDS
public static final int MAX_ROUNDS
LimeConsole
public LimeConsole(AgentID a,
LimeTupleSpace lts,
IConsoleProvider p)
- Create a new Lime console associated with the Lime tuple space passed as
a parameter.
quit
public void quit()
isOpQueueEmpty
public boolean isOpQueueEmpty()
- Returns
true
if the queue of operations is empty,
false
otherwise.
performQueuedOp
public java.lang.String performQueuedOp()
- Process the first element in the operation queue.
Note: calls to this method block if there are no elements
in the queue, until an operation is added through the user interface.
display
public void display(java.lang.String msg)
- Display a message on the console.
getLimeTupleSpace
public LimeTupleSpace getLimeTupleSpace()
- Return the Lime tuple space associated with this Lime console.