title: Java Heartbeat framework
body: <p>I need to implement a heartbeat-mechanism that sends a 'touch'-message to an external service every X seconds to keep the session alive, if no other messages are sent to the service. I have looked at using things like ScheduledExecutorService or Timer but I need to find something where I can reset the timer/delay when other messages are sent on the session so that I do not send heartbeats when they are not required.</p>
  
  <p>Are there any known frameworks for this type of heartbeat mechanism, as it would seem like a regular heartbeat functionality? Or, can anyone please point me in the right direction to create an efficient solution for my problem based on standard components?</p>