public void refreshRemoteAgent(APDescription platform,AID ams){
try{
// FIXME. Move all this block into the constructor for better performance
// because it is invariant to the method parameters
ACLMessage request; // variable that keeps the request search message
Action act; // variable that keeps the search action
request = new ACLMessage(ACLMessage.REQUEST);
request.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);
request.setLanguage(FIPANames.ContentLanguage.FIPA_SL0);
request.setOntology(FIPAManagementOntology.NAME);
AMSAgentDescription amsd = new AMSAgentDescription();
SearchConstraints constraints = new SearchConstraints();
constraints.setMaxResults(new Long(-1)); // all results back
// Build a AMS action object for the request
Search s = new Search();
s.setDescription(amsd);
s.setConstraints(constraints);
act = new Action();
act.setAction(s);
// request has been already initialized in the constructor
request.clearAllReceiver();
request.addReceiver(ams);
act.setActor(ams); // set the actor of this search action
getContentManager().fillContent(request, act);
addBehaviour(new handleRefreshRemoteAgentBehaviour ("search",request,platform));
}catch(Exception e){