repserver
Class RepServer

java.lang.Object
  |
  +--fipaos.agent.FIPAOSAgent
        |
        +--repserver.RepServer
All Implemented Interfaces:
fipaos.agent.conversation.ConversationListener, LocalMsg

public class RepServer
extends fipaos.agent.FIPAOSAgent
implements LocalMsg

RepServer implements a proxy for replicant groups.

The RepServer extends the FIPAOSAgent shell.

RepServer manages a set of replicant groups (RepGroup). Each group consisting of a list of the agentids making up the group. The RepServer manages updating The repserver performs three tasks:

All requests are sent using the repserver-management ontology. Any other ontology is ignored. The possible requests are: When a replicate request is recieved, or a create, agents are created in this process space. Agents seeking to register can come from any process space.


Inner Class Summary
 class RepServer.ActivateTask
           
 class RepServer.CheckRepGroupTask
          Check a replicant group.
 class RepServer.CreateTask
          Create N agents that will register with an existing replication group.
 class RepServer.IdleTask
          IdleTask.
 class RepServer.PingRepGroupsTask
          Calls PingRepGroupTask for each RepGroup in this RepServer When that completes it calls CheckRepGroup when that completes UpdateRepGroup.
 class RepServer.PingTask
          Sends a PING request to the given agent.
 class RepServer.PingUpdateTask
          manages the PingRepGroupsTask tasks.
 class RepServer.RegisterTask
          Register an agent
 class RepServer.ReplicateTask
          Create a replicant group
 class RepServer.StateTask
          One of the replicant groups active agents wants to send its state.
 class RepServer.UpdateAgentTask
          Sends a LOADSTATE request to the given agent.
 class RepServer.UpdateRepGroupTask
           
 
Inner classes inherited from class fipaos.agent.FIPAOSAgent
fipaos.agent.FIPAOSAgent.TopLevelHandlerTask
 
Fields inherited from class fipaos.agent.FIPAOSAgent
_database_profile, _registered_with, _state, _tm
 
Constructor Summary
RepServer(java.lang.String platform, java.lang.String name, java.lang.String ownership, java.lang.String gui)
          constructor - sets up an IdleTask as the default ListenerTask for incoming messages, and starts off registration with the AMS and DF
 
Method Summary
 void activate()
          This method is invoked when GUI should be shown - generally this is invoked by the AgentLoader when the Agent is in the List of running Agents - the default implementation in FIPAOSAgent does nothing.
 int getConvs()
           
 LocalPostOffice getLocalPostOffice()
           
static void main(java.lang.String[] args)
          Test-harness
 void removeConv(fipaos.agent.conversation.Conversation conv)
           
 boolean sendReply(fipaos.ont.fipa.ACL orig_acl, java.lang.String performative)
           
 boolean sendReply(fipaos.ont.fipa.ACL orig_acl, java.lang.String performative, java.lang.Object content)
           
 void setLocalPostOffice(LocalPostOffice lpo)
           
 void shutdown()
          Invoked when this Agent is about to be shutdown - this overrides the shutdown() method in the FIPAOSAgent class to enable the RepServerGUI associated with this RepServer to be removed
 void writeMsg(java.lang.String msg)
          write a message, either to the GUI or to system.out
 
Methods inherited from class fipaos.agent.FIPAOSAgent
addNewProtocol, deregisterWithAMS, deregisterWithDF, forward, forward, getAID, getCM, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, knowsProtocol, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, registeredWith, registeredWithAMS, registeredWithDF, registerWithAMS, registerWithAMS, registerWithAMS, registerWithAMS, registerWithDF, registerWithDF, registerWithDF, registerWithDF, sendNotUnderstood, sendNotUnderstood, setListenerTask, setMessageSender, startPushing, waitForPushLock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RepServer

public RepServer(java.lang.String platform,
                 java.lang.String name,
                 java.lang.String ownership,
                 java.lang.String gui)
constructor - sets up an IdleTask as the default ListenerTask for incoming messages, and starts off registration with the AMS and DF
Method Detail

shutdown

public void shutdown()
Invoked when this Agent is about to be shutdown - this overrides the shutdown() method in the FIPAOSAgent class to enable the RepServerGUI associated with this RepServer to be removed
Overrides:
shutdown in class fipaos.agent.FIPAOSAgent

activate

public void activate()
This method is invoked when GUI should be shown - generally this is invoked by the AgentLoader when the Agent is in the List of running Agents - the default implementation in FIPAOSAgent does nothing.
Overrides:
activate in class fipaos.agent.FIPAOSAgent

writeMsg

public void writeMsg(java.lang.String msg)
write a message, either to the GUI or to system.out

setLocalPostOffice

public void setLocalPostOffice(LocalPostOffice lpo)
Specified by:
setLocalPostOffice in interface LocalMsg

getLocalPostOffice

public LocalPostOffice getLocalPostOffice()
Specified by:
getLocalPostOffice in interface LocalMsg

getConvs

public int getConvs()

removeConv

public void removeConv(fipaos.agent.conversation.Conversation conv)

sendReply

public boolean sendReply(fipaos.ont.fipa.ACL orig_acl,
                         java.lang.String performative,
                         java.lang.Object content)

sendReply

public boolean sendReply(fipaos.ont.fipa.ACL orig_acl,
                         java.lang.String performative)

main

public static void main(java.lang.String[] args)
Test-harness