jade.domain
Class df

java.lang.Object
  |
  +--jade.core.Agent
        |
        +--jade.gui.GuiAgent
              |
              +--jade.domain.df

public class df
extends GuiAgent
implements DFGUIAdapter

Standard Directory Facilitator agent. This class implements FIPA DF agent. JADE applications cannot use this class directly, but interact with it through ACL message passing. The DFService class provides a number of static methods that facilitate this task. More DF agents can be created by application programmers to divide a platform into many Agent Domains.

A DF agent accepts a number of optional configuration parameters that can be set either as command line options or within a properties file (to be passed to the DF as an argument).

For instance the following command line will launch a JADE main container with a DF that will store its catalogue into a database accessible at URL jdbc:odbc:dfdb and that will keep agent registrations for 1 hour at most.

java jade.Boot -gui -jade_domain_df_db-url jdbc:odbc:dfdb -jade_domain_df_maxleasetime 3600000

Each DF has a GUI but, by default, it is not visible. The GUI of the agent platform includes a menu item that allows to show the GUI of the default DF. In order to show the GUI, you should simply send the following message to each DF agent: (request :content (action DFName (SHOWGUI)) :ontology JADE-Agent-Management :protocol fipa-request)

Version:
$Date: 2003/03/17 11:07:23 $ $Revision: 2.26 $
Author:
Giovanni Rimassa - Universita` di Parma, Tiziana Trucco - TILAB S.p.A., Elisabetta Cortese - TILAB S.p.A.
See Also:
DFService, Serialized Form

Fields inherited from class jade.core.Agent
AP_ACTIVE, AP_DELETED, AP_IDLE, 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
 
Fields inherited from interface jade.domain.DFGUIAdapter
CLOSEGUI, DEREGISTER, EXIT, FEDERATE, MODIFY, REFRESHAPPLET, REGISTER, SEARCH
 
Constructor Summary
df()
           
 
Method Summary
 void addParent(AID dfName, DFAgentDescription dfd)
          This method can be used to add a parent (a DF with which the this DF is federated).
protected  void deregisterFromAction(Action a, ACLMessage request)
           
protected  void federateWithAction(Action a, ACLMessage request)
           
 DFAgentDescription getDescriptionOfThisDF()
          This method returns the current description of this DF
 DFAgentDescription getDescriptionOfThisDF(AID parent)
          This method returns the description of this df used to federate with the given parent
protected  ACLMessage getDescriptionOfThisDFAction(Action a, ACLMessage request)
           
protected  ACLMessage getDescriptionUsedAction(Action a, ACLMessage request)
           
 DFAgentDescription getDFAgentDsc(AID name)
          This method returns the descriptor of an agent registered with the df.
protected  ACLMessage getParentAction(Action a, ACLMessage request)
           
protected  void modifyOnAction(Action a, ACLMessage request)
           
protected  void onGuiEvent(GuiEvent ev)
           
protected  void registerWithAction(Action a, ACLMessage request)
           
 void removeParent(AID dfName)
          this method can be used to remove a parent (a DF with which this DF is federated).
protected  void searchOnAction(Action a, ACLMessage request)
           
 void setDescriptionOfThisDF(DFAgentDescription dfd)
          This method set the description of the df according to the DFAgentDescription passed.
protected  void setup()
          This method starts all behaviours needed by DF agent to perform its role within JADE agent platform.
 boolean showGui()
          This method make visible the GUI of the DF.
protected  void showGuiAction(Action a)
           
protected  void takeDown()
          Cleanup DF on exit.
 
Methods inherited from class jade.gui.GuiAgent
postGuiEvent
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, doActivate, doClone, doDelete, doMove, doStart, doSuspend, doTimeOut, doWait, doWait, doWake, extractPassword, extractUsername, getAID, getAMS, getArguments, getAuthority, getCertificateFolder, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getLocalName, getName, getO2AObject, getPrincipal, getProperty, getQueueSize, getState, here, notifyChangeBehaviourState, notifyRestarted, postMessage, putBack, putO2AObject, read, read, receive, receive, removeBehaviour, restartLater, restore, run, send, setArguments, setEnabledO2ACommunication, setOwnership, setPrincipal, setQueueSize, waitUntilStarted, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

df

public df()
Method Detail

showGuiAction

protected void showGuiAction(Action a)
                      throws FailureException

getParentAction

protected ACLMessage getParentAction(Action a,
                                     ACLMessage request)
                              throws FailureException

getDescriptionOfThisDFAction

protected ACLMessage getDescriptionOfThisDFAction(Action a,
                                                  ACLMessage request)
                                           throws FailureException

federateWithAction

protected void federateWithAction(Action a,
                                  ACLMessage request)

getDescriptionUsedAction

protected ACLMessage getDescriptionUsedAction(Action a,
                                              ACLMessage request)
                                       throws FailureException

deregisterFromAction

protected void deregisterFromAction(Action a,
                                    ACLMessage request)

registerWithAction

protected void registerWithAction(Action a,
                                  ACLMessage request)

modifyOnAction

protected void modifyOnAction(Action a,
                              ACLMessage request)

searchOnAction

protected void searchOnAction(Action a,
                              ACLMessage request)

setup

protected void setup()
This method starts all behaviours needed by DF agent to perform its role within JADE agent platform.
Overrides:
setup in class Agent
Tags copied from class: Agent
See Also:
Agent.addBehaviour(Behaviour b), Behaviour

takeDown

protected void takeDown()
Cleanup DF on exit. This method performs all necessary cleanup operations during agent shutdown.
Overrides:
takeDown in class Agent

showGui

public boolean showGui()
This method make visible the GUI of the DF.
Returns:
true if the GUI was not visible already, false otherwise.

onGuiEvent

protected void onGuiEvent(GuiEvent ev)
Overrides:
onGuiEvent in class GuiAgent

getDFAgentDsc

public DFAgentDescription getDFAgentDsc(AID name)
                                 throws FIPAException
This method returns the descriptor of an agent registered with the df.
Specified by:
getDFAgentDsc in interface DFGUIAdapter

setDescriptionOfThisDF

public void setDescriptionOfThisDF(DFAgentDescription dfd)
This method set the description of the df according to the DFAgentDescription passed. The programmers can call this method to provide a different initialization of the description of the df they are implementing. The method is called inside the setup of the agent and set the df description using a default description.

getDescriptionOfThisDF

public DFAgentDescription getDescriptionOfThisDF()
This method returns the current description of this DF
Specified by:
getDescriptionOfThisDF in interface DFGUIAdapter

getDescriptionOfThisDF

public DFAgentDescription getDescriptionOfThisDF(AID parent)
This method returns the description of this df used to federate with the given parent
Specified by:
getDescriptionOfThisDF in interface DFGUIAdapter

addParent

public void addParent(AID dfName,
                      DFAgentDescription dfd)
This method can be used to add a parent (a DF with which the this DF is federated).
Parameters:
dfName - the parent df (the df with which this df has been registered)
dfd - the description used by this df to register with the parent.

removeParent

public void removeParent(AID dfName)
this method can be used to remove a parent (a DF with which this DF is federated).