public void run() {
   ITELogger.log(Level.INFO, "checking lease...");
   synchronized (_routingTable) {
     Set<RegistrationData> keys = _routingTable.keySet();
     RegistrationData[] datas = keys.toArray(new RegistrationData[keys.size()]);
     for (RegistrationData data : datas) {
       if (data.getLease() != 0 && System.currentTimeMillis() > data.getLease() * 1000) {
         ITELogger.log(
             Level.INFO, "deregistering due to expried lease: " + data.getEntity().getId());
         deregister(data.getEntity().getId());
       }
     }
   }
 }
 public synchronized void onReception(Connection connection, RegisterAgent message)
     throws FITTESTException {
   if (message.getType()
       != null) { // if null => possibility of a renew lease after the agent deregistered (or any
                  // other possible cause)
     RegistrationData data =
         getService()
             .registerAgent(
                 connection.getRemoteAddress().split(":")[0],
                 new Integer(connection.getRemoteAddress().split(":")[1]),
                 message.getEnvironment(),
                 message.getType(),
                 message.getDescription(),
                 message.getFrom());
     message.setFrom(data.getEntity().getId());
     message.setTo(data.getIteid());
     RegisterAgentReponse response =
         FITTESTSingleton.getObjectFactory().createRegisterAgentReponse();
     response.setFittestAgentId(data.getEntity().getId());
     response.setFittestIteId(data.getIteid());
     response.setFittestLease(data.getLease());
     reply(connection, message, response);
   }
 }