public static boolean isConnected(
      final Application application, final String id, final Duration timeout) {
    final Time time = TimerChannelBehavior.getLastPollEvent(application, id);
    boolean isConnected;
    if (time == null) {
      // the behavior has been cleaned
      return false;
    }
    isConnected = time.elapsedSince().compareTo(timeout) < 0;
    if (!isConnected) {
      // timeout expired, the page is probably not connected anymore

      // we clean the metadata to avoid memory leak
      TimerChannelBehavior.cleanMetadata(application, id);
    }
    return isConnected;
  }
 /**
  * Methods used to access the triggers queued for the the behavior to which this target
  * corresponds.
  *
  * @return a List of triggers queued for the current component
  */
 private List<DelayedMethodCallList> getTriggers() {
   return TimerChannelBehavior.getTriggers(application, id);
 }
 public boolean isConnected() {
   return TimerChannelBehavior.isConnected(application, id, timeout);
 }