anthill.nest
Interface RequestSet

All Superinterfaces:
Clearable
All Known Implementing Classes:
LocalRequestSet, RequestSet

public interface RequestSet
extends Clearable

The RequestSet interface represents a data structure containing associations between request 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: 1.9 $
Author:
Alberto Montresor

Field Summary
static String NAME
          Identifier used in the configuration files
 
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
 

Field Detail

NAME

public static final String NAME
Identifier used in the configuration files

See Also:
Constant Field Values
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.