anthill.nest
Interface RequestSet

All Superinterfaces:
Clearable
All Known Implementing Classes:
LocalRequestSet

public interface RequestSet
extends Clearable

The RequestSet interface represents a data structure containing associations between ant identifiers and listeners interested in the responses returned by those ants.

RequestSet is one of the components of a nest; the other are Manager), Trail, Storage and Gate.

Version:
$Revision$
Author:
Alberto Montresor

Method Summary
 void add(RequestId key, ResponseListener listener)
          Adds an association between a key and the listener interested in the responses returned by this ant.
 boolean returnResources(RequestId key, Resource[] resources)
          Returns the specified resources to the listener associated to the given key
 
Methods inherited from interface anthill.util.Clearable
clear
 

Method Detail

add

public void add(RequestId key,
                ResponseListener listener)
Adds an association between a key and the listener interested in the responses returned by this ant.
Parameters:
key - the key that will be used later to obtain the listener
listener - the listener which will be notified when a response is available

returnResources

public boolean returnResources(RequestId key,
                               Resource[] resources)
Returns the specified resources to the listener associated to the given key
Parameters:
key - the key that is used to obtain listener
resources - the resources found.