org.iids.aos.locationmanager
Class LocationConfigurationModule

java.lang.Object
  extended by org.iids.aos.systemservices.module.AbstractModule
      extended by org.iids.aos.systemservices.module.AbstractRunnableModule
          extended by org.iids.aos.locationmanager.LocationConfigurationModule
All Implemented Interfaces:
java.lang.Runnable, Module

public class LocationConfigurationModule
extends AbstractRunnableModule

Author:
mobach@cs.vu.nl Module of the locationmanager that handles registration of new hosts, and the configuration of these hosts.

Constructor Summary
LocationConfigurationModule(Communicator _comm, AgentScapeConfig _asc, AsLookupService lookupService, AgentScapeDCNegotiationModule negotiationModule)
           
 
Method Summary
 AgentScapeID createAgentScapeID()
           
 boolean deregister(AgentScapeID id)
          Deregister host manager from this location.
 java.util.List<AgentScapeID> findSuitableHosts(Specifications agentSpecifications)
          returns a list of hostmanager id's on which the agent is able to run.
 HostManager getHostmanager(AgentScapeID hostManagerId)
           
 Address getHostmanagerAddress(AgentScapeID hostManagerId)
           
 java.util.HashMap<AgentScapeID,HostManagerInfo> getHostmanagers()
           
 java.util.HashMap<AgentScapeID,Address> listHosts()
          List all hosts that are not only registered, but also configured by this location manager.
 void pulse()
          The task of this module is to handle any newly registered hostmanagers that have been started at the host that have announced themselves.
 int register(AgentScapeID id, Address address)
          Register host manager at the location manager.
 void setLocationServletModule(LocationServletModule lsm)
           
 void shutdown()
          Each abstract RUNNABLE module implementation must implement the shutdown method, which is called whenever the module is stopped (by AbstractRunnableModule.stop()) from the superclass.
 
Methods inherited from class org.iids.aos.systemservices.module.AbstractRunnableModule
isStarted, run, start, stop
 
Methods inherited from class org.iids.aos.systemservices.module.AbstractModule
getCommunicator, getModuleName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocationConfigurationModule

public LocationConfigurationModule(Communicator _comm,
                                   AgentScapeConfig _asc,
                                   AsLookupService lookupService,
                                   AgentScapeDCNegotiationModule negotiationModule)
Method Detail

shutdown

public void shutdown()
Description copied from class: AbstractRunnableModule
Each abstract RUNNABLE module implementation must implement the shutdown method, which is called whenever the module is stopped (by AbstractRunnableModule.stop()) from the superclass.

Specified by:
shutdown in class AbstractRunnableModule

setLocationServletModule

public void setLocationServletModule(LocationServletModule lsm)

pulse

public void pulse()
The task of this module is to handle any newly registered hostmanagers that have been started at the host that have announced themselves.

Specified by:
pulse in class AbstractRunnableModule

getHostmanagers

public java.util.HashMap<AgentScapeID,HostManagerInfo> getHostmanagers()

listHosts

public java.util.HashMap<AgentScapeID,Address> listHosts()
List all hosts that are not only registered, but also configured by this location manager. This is useful for waiting on a host to be configured.

Returns:
A list of configured and registered hosts that are part of this location.

register

public int register(AgentScapeID id,
                    Address address)
Register host manager at the location manager.

Implements LocationManager.register(org.iids.aos.systemservices.communicator.structs.AgentScapeID, org.iids.aos.systemservices.communicator.structs.Address).

Parameters:
id - The AgentScapeID of the host manager
address - The address (kernel endpoint) of the host manager
Returns:
The timeout interval after which renewal is needed.

deregister

public boolean deregister(AgentScapeID id)
Deregister host manager from this location.

Implements LocationManager.deregister(org.iids.aos.systemservices.communicator.structs.AgentScapeID).

Parameters:
id - id of the hostmanager that should be deregistered
Returns:
0 if deregistration succeeded, -1 otherwise
See Also:
register(org.iids.aos.systemservices.communicator.structs.AgentScapeID, org.iids.aos.systemservices.communicator.structs.Address)

createAgentScapeID

public AgentScapeID createAgentScapeID()

findSuitableHosts

public java.util.List<AgentScapeID> findSuitableHosts(Specifications agentSpecifications)
returns a list of hostmanager id's on which the agent is able to run. Only checks for the language spec for now...

Parameters:
agentSpecifications -
Returns:
list of hostmanager id's on which the agent is able to run

getHostmanager

public HostManager getHostmanager(AgentScapeID hostManagerId)

getHostmanagerAddress

public Address getHostmanagerAddress(AgentScapeID hostManagerId)


Copyright © 2003, 2004 IIDS Group. All Rights Reserved.