jade.tools.sniffer
Class Sniffer

java.lang.Object
  |
  +--jade.core.Agent
        |
        +--jade.tools.sniffer.Sniffer

public class Sniffer
extends jade.core.Agent

This is the Sniffer agent.
This class implements the low level part of the Sniffer, interacting with Jade environment and with the sniffer GUI.
At startup, the sniffer subscribes itself as an rma to be informed every time an agent is born or dead, a container is created or deleted.
For more information see Introduction to the Sniffer

Author:
Alessandro Beneventi (Developement), Gianluca Tanca (Concept & Early Version)
See Also:
Serialized Form

Field Summary
static boolean SNIFF_OFF
           
static boolean SNIFF_ON
           
 
Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_INITIATED, AP_MAX, AP_MIN, AP_SUSPENDED, AP_TRANSIT, AP_WAITING, currentBehaviour, currentMessage, D_ACTIVE, D_MAX, D_MIN, D_RETIRED, D_SUSPENDED, D_UNKNOWN, MSG_QUEUE_SIZE
 
Constructor Summary
Sniffer()
           
 
Method Summary
 void setup()
          ACLMessages for subscription and unsubscription as rma are created and corresponding behaviours are set up.
 void sniffMsg(java.util.Vector agentVect, boolean onFlag)
          Creates the ACLMessage to be sent to the Ams with the list of the agent to be sniffed/unsniffed.
 void takeDown()
          Cleanup during agent shutdown.
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, deregisterLanguage, deregisterOntology, doActivate, doClone, doDelete, doMove, doStart, doSuspend, doWait, doWait, doWake, extractContent, fillContent, getAID, getAMS, getDefaultDF, getHap, getLocalName, getName, getQueueSize, getState, lookupLanguage, lookupOntology, notifyRestarted, postMessage, putBack, read, read, receive, receive, registerLanguage, registerOntology, removeBehaviour, restartLater, restore, run, send, setQueueSize, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SNIFF_ON

public static final boolean SNIFF_ON

SNIFF_OFF

public static final boolean SNIFF_OFF
Constructor Detail

Sniffer

public Sniffer()
Method Detail

setup

public void setup()
ACLMessages for subscription and unsubscription as rma are created and corresponding behaviours are set up.
Overrides:
setup in class jade.core.Agent

takeDown

public void takeDown()
Cleanup during agent shutdown. This method cleans things up when Sniffer agent is destroyed, disconnecting from AMS agent and closing down the Sniffer administration GUI. Currently sniffed agents are also unsniffed to avoid errors.
Overrides:
takeDown in class jade.core.Agent

sniffMsg

public void sniffMsg(java.util.Vector agentVect,
                     boolean onFlag)
Creates the ACLMessage to be sent to the Ams with the list of the agent to be sniffed/unsniffed. The internal list of sniffed agents is also updated.
Parameters:
agentVect - vector containing TreeData item representing the agents
onFlag - can be:
  • Sniffer.SNIFF_ON to activate sniffer on an agent/group
  • Sniffer.SNIFF_OFF to deactivate sniffer on an agent/group