jade.domain
Class df

java.lang.Object
  |
  +--jade.core.Agent
        |
        +--jade.gui.GuiAgent
              |
              +--jade.domain.df
All Implemented Interfaces:
java.lang.Runnable, Serializable, java.io.Serializable

public class df
extends jade.gui.GuiAgent

Standard Directory Facilitator agent. This class implements FIPA DF agent. JADE applications typically don't use this class directly, but interact with the DF agent 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).

Parameter Description
jade_domain_df_autocleanup If set to true, indicates that the DF will automatically clean up registrations as soon as an agent terminates. The default is false
jade_domain_df_maxleasetime Indicates the maximum lease time (in millisecond) that the DF will grant for agent description registrations (defaults to infinite).
jade_domain_df_maxresult Indicates the maximum number of items found in a search operation that the DF will return to the requester (defaults to 100).
jade_domain_df_disablevalidation Turns off content validation on incoming/outgoing messages (defaults to false)
jade_domain_df_db-default If set to true, indicates that the DF will store its catalogue into an internal HSQL database, running within the same VM. (The HSQL jar files have to added to the Java CLASSPATH)
jade_domain_df_db-url Indicates the JDBC URL of the database the DF will store its catalogue into. This parameter is ignored if jade_domain_df_db-default is set. If neither this parameter nor jade_domain_df_db-default is specified the DF will keep its catalogue in memory.
jade_domain_df_db-driver Indicates the JDBC driver to be used to access the DF database (defaults to the ODBC-JDBC bridge). This parameter is ignored if jade_domain_df_db-url is not set or jade_domain_df_db-default is set.
jade_domain_df_db-username, jade_domain_df_db-password Indicate the username and password to be used to access the DF database (default to null). These parameters are ignored if jade_domain_df_db-url is not set or jade_domain_df_db-default is set.
jade_domain_df_db-cleantables If set to true, indicates that the DF will clean the content of all pre-existing database tables, used by the DF. This parameter is ignored if the catalogue is not stored in a database.
jade_domain_df_db-abortonerror If set to true, indicates that the DF will immediately terminate in case it cannot connect to the database. This parameter is ignored if the catalogue is not stored in a database.
jade_domain_df_kb-factory Indicates the name of the factory class that should be used to create the knowledge base objects for the DF. The class has to be a sub class of jade.domain.DFKBFactory.
jade_domain_df_poolsize The dimension of the pool of thread dedicated to serving registration, deregistration and search requests. If 0 (default) is specified then registration, deregistration and search requests are served directly by the df agent Thread. This parameter is ignored when using a volatile (in-memory) knowledge base.

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: 2007-03-30 18:30:14 +0200 (ven, 30 mar 2007) $ $Revision: 5952 $
Author:
Giovanni Rimassa - Universita' di Parma, Tiziana Trucco - TILAB S.p.A., Elisabetta Cortese - TILAB S.p.A., Giovanni Caire - TILAB, Roland Mungenast - Profactor
See Also:
DFService, Serialized Form

Nested Class Summary
 
Nested classes inherited from class jade.core.Agent
Agent.Interrupted
 
Constructor Summary
df()
           
 
Method Summary
protected  void addParent(AID dfName, DFAgentDescription dfd)
          This method can be used to add a parent (a DF this DF is federated with).
 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
 DFAgentDescription getDFAgentDsc(AID name)
          This method returns the description of an agent registered with the DF.
protected  void removeParent(AID dfName)
          this method can be used to remove a parent (a DF with which this DF is federated).
protected  void setDescriptionOfThisDF(DFAgentDescription dfd)
          This method set the description of the df according to the DFAgentDescription passed.
protected  boolean showGui()
          This method make visible the GUI of the DF.
 
Methods inherited from class jade.gui.GuiAgent
onGuiEvent, postGuiEvent
 
Methods inherited from class jade.core.Agent
addBehaviour, afterClone, afterMove, beforeClone, beforeMove, blockingReceive, blockingReceive, blockingReceive, blockingReceive, changeStateTo, doActivate, doClone, doDelete, doMove, doSuspend, doWait, doWait, doWake, getAgentState, getAID, getAMS, getArguments, getContainerController, getContentManager, getCurQueueSize, getDefaultDF, getHap, getHelper, getLocalName, getName, getO2AObject, getProperty, getQueueSize, here, isRestarting, postMessage, putBack, putO2AObject, receive, receive, removeBehaviour, restore, restoreBufferedState, send, setEnabledO2ACommunication, setQueueSize, setup, takeDown, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Runnable
run
 

Constructor Detail

df

public df()
Method Detail

getDFAgentDsc

public DFAgentDescription getDFAgentDsc(AID name)
                                 throws FIPAException
This method returns the description of an agent registered with the DF.

FIPAException

getDescriptionOfThisDF

public DFAgentDescription getDescriptionOfThisDF()
This method returns the current description of this DF


getDescriptionOfThisDF

public DFAgentDescription getDescriptionOfThisDF(AID parent)
This method returns the description of this df used to federate with the given parent


showGui

protected boolean showGui()
This method make visible the GUI of the DF.

Returns:
true if the GUI was not visible already, false otherwise.

setDescriptionOfThisDF

protected 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.


addParent

protected void addParent(AID dfName,
                         DFAgentDescription dfd)
This method can be used to add a parent (a DF this DF is federated with).

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

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



JADE