antsim.impl
Class GenericResponseMonitor

java.lang.Object
  |
  +--antsim.impl.GenericResponseMonitor
All Implemented Interfaces:
Clearable, ResponseListener, ResponseMonitor

public class GenericResponseMonitor
extends Object
implements Clearable, ResponseMonitor, ResponseListener

Class GenericResponseMonitor is

Version:
$Revision: 1.3 $
Author:
Alberto Montresor
, Hein Meling

Field Summary
 
Fields inherited from interface antsim.ResponseMonitor
NAME
 
Constructor Summary
GenericResponseMonitor(Factory factory, String name)
          Instantiates a new GenericResponseMonitor.
 
Method Summary
 void clear()
          Restores the object to its initial state.
 void complete()
          Upcall method used to notify this listener that the given request has finished returning resources.
 void returnResources(RequestId rid, Resource[] resources)
          Upcall method used to notify this listener that the given request has returned the specified set of resources.
 void setStatistics(Stats stats)
           
 void startRequest(RequestId rid)
          Must be invoked prior to invoking a request on a nest, to ensure that the given request is stored to enable lookup on responses.
 void tick()
           
 void tick(int v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericResponseMonitor

public GenericResponseMonitor(Factory factory,
                              String name)
Instantiates a new GenericResponseMonitor.

Parameters:
factory - the factory to be used to read configuration arguments and to create other configurable objects
name - the name that is associated to this instance in the configuration file
Method Detail

clear

public void clear()
Restores the object to its initial state.

Specified by:
clear in interface Clearable

setStatistics

public void setStatistics(Stats stats)
Specified by:
setStatistics in interface ResponseMonitor

tick

public void tick()
Specified by:
tick in interface ResponseMonitor

tick

public void tick(int v)
Specified by:
tick in interface ResponseMonitor

startRequest

public void startRequest(RequestId rid)
Must be invoked prior to invoking a request on a nest, to ensure that the given request is stored to enable lookup on responses.

Specified by:
startRequest in interface ResponseMonitor

returnResources

public void returnResources(RequestId rid,
                            Resource[] resources)
Upcall method used to notify this listener that the given request has returned the specified set of resources.

Specified by:
returnResources in interface ResponseListener
Parameters:
rid - the request identifier for the returned resources.
resources - the resources found.
Returns:
true if the timeout has passed.

complete

public void complete()
Upcall method used to notify this listener that the given request has finished returning resources.

Specified by:
complete in interface ResponseListener