|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Nest
is the interface used by nest users
to communicate with nests. The basic methods contained in this
interface enable the user to search resources, to insert
resources in the Anthill network and to add knowledge
about other nests.
Field Summary | |
static String |
NAME
Identifier used in the configuration files |
Method Summary | |
void |
addAntNeighbour(NestId nid)
Adds the identifier of a new neighbour nest to the set of neighbours known to this nest, on behalf of an ant visiting the nest. |
void |
addClientNeighbour(NestId nid)
Adds the identifier of a new neighbour nest to the set of neighbours known to this nest, on behalf of the nest user. |
ResourceManager |
createResourceManager(String name,
String species)
Returns a reference to the resource manager associated to the specified ant species and identified by the given name. |
Neighbour[] |
getNeighbours()
Returns information about the neighbours known to this nest. |
NestId |
getNestId()
Returns the identifier of this nest |
ResourceManager |
getResourceManager(String name,
String species)
Returns a reference to the resource manager associated to the specified ant species and identified by the given name. |
void |
removeNeighbour(NestId nid)
Removes the identifier of a neighbour nest from the set of neighbours known to this Nest. |
void |
request(RequestId rid,
Object request,
ResponseListener listener)
Accepts a resource request originated by the user of this nest. |
Methods inherited from interface anthill.util.Clearable |
clear |
Field Detail |
public static final String NAME
Method Detail |
public NestId getNestId()
public ResourceManager getResourceManager(String name, String species)
species
is used to discriminate among ant species. If no resource manager is
associated to species
and is identified by name
,
the method returns null
.
name
- the name of the manager to obtain a reference tospecies
- the name of the ant species to which the manager is
associated
null
if no such resource manager is found.public ResourceManager createResourceManager(String name, String species) throws ResourceManagerException
species
is used to discriminate among ant species. If no resource manager is
associated to species
and is identified by name
,
a new resource manager is created, using name
as
lookup identifier in the factory object to obtain the current configuration.
name
- the name of the manager to obtain a reference tospecies
- the name of the ant species to which the manager is
associated
null
if no such resource manager is found.
ResourceManager
- this exception is thrown if, for some reason,
it is impossible to create a resource manager
ResourceManagerException
public void request(RequestId rid, Object request, ResponseListener listener)
Resource
object will be returned to the specified resource listener.
rid
- the request identifier, created and managed by the
invoker of this method.request
- the request to be satisfiedlistener
- The listener object which will be notified
when the request is completed.public void addClientNeighbour(NestId nid)
The exact behavior of this method depends on the implementation of the gate object contained in the nest. Please refer to the documentation of the resource storage implementation for more details.
nid
- the identifier of the neighbour to be addedpublic void addAntNeighbour(NestId nid)
The exact behavior of this method depends on the implementation of the gate object contained in the nest. Please refer to the documentation of the resource storage implementation for more details.
nid
- the identifier of the neighbour to be addedpublic void removeNeighbour(NestId nid)
The exact behavior of this method depends on the implementation of the gate object contained in the nest. Please refer to the documentation of the resource storage implementation for more details.
nid
- the identifier of the neighbour to be removedpublic Neighbour[] getNeighbours()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |