Package jade.tools

Class ToolAgent

  • All Implemented Interfaces:
    TimerListener, Serializable, Serializable, Runnable
    Direct Known Subclasses:
    Introspector, rma, Sniffer, ToolNotifier

    public abstract class ToolAgent
    extends Agent
    This abstract class is the common ancestor of all JADE tools (RMA, Sniffer, Introspector, etc.). It provides suitable behaviours to interact with the AMS, registering for interesting events and requesting actions when needed.
    Version:
    $Date$ $Revision$
    Author:
    Giovanni Rimassa - Universita' di Parma
    See Also:
    Serialized Form
    • Field Detail

      • logger

        protected transient Logger logger
    • Constructor Detail

      • ToolAgent

        public ToolAgent()
        Default constructor.
    • Method Detail

      • toolSetup

        protected void toolSetup()
        This method is invoked just after the generic agent setup. Subclasses must use this method the same way ordinary agents use their setup() method.
      • toolTakeDown

        protected void toolTakeDown()
        This method is invoked just before the generic agent takedown. Subclasses must use this method the same way ordinary agents use their takeDown() method.
      • getSubscribe

        protected ACLMessage getSubscribe()
        Retrieve the subscribe ACL message with which this tool agent subscribed with the AMS.
        Returns:
        The subscription ACL message.
      • getCancel

        protected ACLMessage getCancel()
        Retrieve the cancel ACL message with which this tool agent removes its subscription with the AMS.
        Returns:
        The cancellation ACL message.
      • getRequest

        protected ACLMessage getRequest()
        Retrieve the request ACL message with which this tool agent requests the AMS tool-specific actions.
        Returns:
        The request ACL message.
      • setup

        public final void setup()
        Description copied from class: Agent
        This protected method is an empty placeholder for application specific startup code. Agent developers can override it to provide necessary behaviour. When this method is called the agent has been already registered with the Agent Platform AMS and is able to send and receive messages. However, the agent execution model is still sequential and no behaviour scheduling is active yet. This method can be used for ordinary startup tasks such as DF registration, but is essential to add at least a Behaviour object to the agent, in order for it to be able to do anything.
        Overrides:
        setup in class Agent
        See Also:
        Agent.addBehaviour(Behaviour b), Behaviour
      • takeDown

        protected final void takeDown()
        Description copied from class: Agent
        This protected method is an empty placeholder for application specific cleanup code. Agent developers can override it to provide necessary behaviour. When this method is called the agent has not deregistered itself with the Agent Platform AMS and is still able to exchange messages with other agents. However, no behaviour scheduling is active anymore and the Agent Platform Life Cycle state is already set to deleted. This method can be used for ordinary cleanup tasks such as DF deregistration, but explicit removal of all agent behaviours is not needed.
        Overrides:
        takeDown in class Agent
      • afterClone

        protected void afterClone()
        Description copied from class: Agent
        Actions to perform after cloning. This empty placeholder method can be overridden by user defined agents to execute some actions just after creating an agent copy to the destination agent container.
        NOT available in MIDP
        Overrides:
        afterClone in class Agent
      • beforeMove

        protected void beforeMove()
        Description copied from class: Agent
        This empty placeholder shall be overridden by user defined agents to execute some actions before the original agent instance on the source container is stopped (e.g. releasing local resources such as a GUI).
        IMPORTANT: At this point, it is ensured that the move process is successful and that a moved agent instance has been created on the destination container Therefore setting the value of a class field in this method will have no impact on the moved agent instance. Such parameters must indeed be set before the doMove() method is called.
        NOT available in MIDP
        Overrides:
        beforeMove in class Agent
      • afterMove

        protected void afterMove()
        Description copied from class: Agent
        Actions to perform after moving. This empty placeholder method can be overridden by user defined agents to execute some actions just after arriving to the destination agent container for a migration.
        NOT available in MIDP
        Overrides:
        afterMove in class Agent
      • afterLoad

        protected void afterLoad()
      • afterThaw

        protected void afterThaw()
      • afterReload

        protected void afterReload()
      • beforeSave

        protected void beforeSave()
      • beforeFreeze

        protected void beforeFreeze()
      • beforeReload

        protected void beforeReload()