/** * Starts a default ping wicket components which uses the indicated duration between ping intervals. * After the elapse of each interval a roundtrip to the server is made using an Ajax call. * When the duration is negative, this wicket component behaves like a plain Label widget. * @param id the wicket id to use * @param interval the time to wait between ping interfals */ public Pinger(String id, Duration interval) { super(id); if (interval != null) { if (interval.greaterThan(0L)) { add(new PingBehavior(interval)); } } else { add(new PingBehavior(Duration.seconds(DEFAULT_INTERVAL_SECONDS))); } }