class HeartbeatTimerTask extends TimerTask {

  @Override
  public void run() {
    renameThread();
    try {
      HeartbeatEvent heartbeat = EventFactory.create(heartbeatEventImp);
      heartbeat.setHeartbeatTime(System.currentTimeMillis());
      heartbeat.extractState(adapter);
      heartbeat.logEvent(log);
      adapter.getEventHandler().send(heartbeat);
    }
    catch (Exception e) {
      log.trace("exception sending heartbeat Event; logging only", e);
    }
  }

  public  HeartbeatTimerTask(Class<HeartbeatEvent> eventImpl, Adapter a);

}