Class Introspector

    • Constructor Detail

      • Introspector

        public Introspector()
    • Method Detail

      • toolSetup

        public void toolSetup()
        Description copied from class: ToolAgent
        This method is invoked just after the generic agent setup. Subclasses must use this method the same way ordinary agents use their setup() method.
        Overrides:
        toolSetup in class ToolAgent
      • 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:
        toolTakeDown in class ToolAgent
      • 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
        Overrides:
        doDelete in class Agent
      • 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:
        1. If we encounter a '*' in the expression token they match.
        2. If there aren't any more characters in the subject string token they don't match.
        3. If we encounter a '?' in the expression token we ignore the subject string's character and move on to the next iteration.
        4. If the character in the expression token isn't equal to the character in the subject string they don't match.
        If we complete the iteration they match only if there are the same number of characters in both strings.
        Parameters:
        aMatchExpression - An expression string with special significance to '?' and '*'.
        aString - The subject string.
        Returns:
        True if they match, false otherwise.