public void register(AID topic) throws ServiceException {
try {
invoke(myAgent.getLocalName(), "register", new Object[]{topic});
}
catch (NotFoundException nfe) {
throw new ServiceException("Registering agent "+myAgent.getLocalName()+" not found on the back-end");
}
catch (IMTPException imtpe) {
throw new ServiceException("Communication error: "+imtpe.getMessage(), imtpe);
}
}
public void deregister(AID topic) throws ServiceException {
try {
invoke(myAgent.getLocalName(), "deregister", new Object[]{topic});
}
catch (NotFoundException nfe) {
throw new ServiceException("Deregistering agent "+myAgent.getLocalName()+" not found on the back-end");
}
catch (IMTPException imtpe) {
throw new ServiceException("Communication error: "+imtpe.getMessage(), imtpe);
}
}
};
sh.init(a);
return sh;