Package jade.tools.introspector
Class Introspector
- java.lang.Object
-
- jade.core.Agent
-
- jade.tools.ToolAgent
-
- jade.tools.introspector.Introspector
-
- All Implemented Interfaces:
TimerListener,Serializable,Serializable,Runnable
public class Introspector extends ToolAgent
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jade.tools.ToolAgent
ToolAgent.AMSListenerBehaviour, ToolAgent.EventHandler
-
Nested classes/interfaces inherited from class jade.core.Agent
Agent.Interrupted
-
-
Field Summary
Fields Modifier and Type Field Description static intBREAK_EVENTstatic intGO_EVENTstatic intKILL_EVENTstatic intSLOW_EVENTstatic intSTEP_EVENTstatic intSUSPEND_EVENT-
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_WAITING, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_CLASS
-
-
Constructor Summary
Constructors Constructor Description Introspector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddAgent(AID name)voiddoDelete()The doDelete() method is re-defined because if the Introspector is killed while it is debugging the AMS a deadlock occurs.AgentTreeModelgetModel()Callback method for platform management GUI.protected booleanisMatch(String aMatchExpression, String aString)Given two strings determine if they match.protected StringpreloadContains(String agentName)Search keys in preload for a string which matches (using isMatch method) the agent name.voidremoveAgent(AID name)voidtoolSetup()This method is invoked just after the generic agent setup.voidtoolTakeDown()Cleanup during agent shutdown.-
Methods inherited from class jade.tools.ToolAgent
afterClone, afterLoad, afterMove, afterReload, afterThaw, beforeFreeze, beforeMove, beforeReload, beforeSave, getCancel, getRequest, getSubscribe, setup, takeDown
-
Methods inherited from class jade.core.Agent
addBehaviour, beforeClone, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, clean, createMessageQueue, doActivate, doClone, doMove, doSuspend, doTimeOut, doWait, doWait, doWake, getAgentState, getAID, getAID, getAMS, getArguments, getBehavioursCnt, getBootProperties, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getExecutedBehavioursCnt, getGenerateBehaviourEvents, getGenerateMessageEvents, getHap, getHelper, getLocalName, getName, getO2AInterface, getO2AObject, getPostedMessagesCnt, getProperty, getQueueSize, getReceivedMessagesCnt, getSentMessagesCnt, getState, here, isAlive, isRestarting, join, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, receive, receive, receive, registerO2AInterface, removeBehaviour, removeTimer, restartLater, restoreBufferedState, restoreFields, run, send, setArguments, setEnabledO2ACommunication, setGenerateBehaviourEvents, setGenerateMessageEvents, setO2AManager, setQueueSize, waitUntilStarted, write
-
-
-
-
Field Detail
-
STEP_EVENT
public static final int STEP_EVENT
- See Also:
- Constant Field Values
-
BREAK_EVENT
public static final int BREAK_EVENT
- See Also:
- Constant Field Values
-
SLOW_EVENT
public static final int SLOW_EVENT
- See Also:
- Constant Field Values
-
GO_EVENT
public static final int GO_EVENT
- See Also:
- Constant Field Values
-
KILL_EVENT
public static final int KILL_EVENT
- See Also:
- Constant Field Values
-
SUSPEND_EVENT
public static final int SUSPEND_EVENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
toolSetup
public void toolSetup()
Description copied from class:ToolAgentThis method is invoked just after the generic agent setup. Subclasses must use this method the same way ordinary agents use theirsetup()method.
-
addAgent
public boolean addAgent(AID name)
-
removeAgent
public void removeAgent(AID name)
-
toolTakeDown
public void toolTakeDown()
Cleanup during agent shutdown. This method cleans things up when RMA agent is destroyed, disconnecting from AMS agent and closing down the platform administration GUI.- Overrides:
toolTakeDownin classToolAgent
-
getModel
public AgentTreeModel getModel()
Callback method for platform management GUI.
-
doDelete
public void doDelete()
The doDelete() method is re-defined because if the Introspector is killed while it is debugging the AMS a deadlock occurs. In fact, while exiting, the Introspector can't make the debugged agents proceed. At the same time however the Introspector can't proceed as it is waiting for the answer to its AMS deregistration
-
preloadContains
protected String preloadContains(String agentName)
Search keys in preload for a string which matches (using isMatch method) the agent name.- Parameters:
agentName- The agent name.- Returns:
- String The key which matched.
-
isMatch
protected boolean isMatch(String aMatchExpression, String aString)
Given two strings determine if they match. We iterate over the match expression string from left to right as follows:- If we encounter a '*' in the expression token they match.
- If there aren't any more characters in the subject string token they don't match.
- If we encounter a '?' in the expression token we ignore the subject string's character and move on to the next iteration.
- If the character in the expression token isn't equal to the character in the subject string they don't match.
- Parameters:
aMatchExpression- An expression string with special significance to '?' and '*'.aString- The subject string.- Returns:
- True if they match, false otherwise.
-
-