@@ -84,10 +84,10 @@ public void removeHub(HubConnector hubConnector) {
8484 */
8585 private void forceNewRound () {
8686 if (this .alarmClock != null ) {
87- Log .writeLog (this , this .toString (), "kill old alarm" );
87+ // Log.writeLog(this, this.toString(), "kill old alarm");
8888 this .alarmClock .kill ();
8989 }
90- Log .writeLog (this , this .toString (), "set new alarm" );
90+ // Log.writeLog(this, this.toString(), "set new alarm");
9191 this .alarmClock = new AlarmClock (forceNewRoundWaitingPeriod , FORCE_NEW_ROUND_KEY , this );
9292 this .alarmClock .start ();
9393 }
@@ -260,14 +260,21 @@ public void forceSyncWithHubs() {
260260
261261 private boolean managerThreadStopped = false ;
262262
263+ private long lastSyncStatusWithConnectedHubs = -1 ;
264+
265+ public long getLastSynchedWithConnectedHubs () {
266+ return this .lastSyncStatusWithConnectedHubs ;
267+ }
268+
263269 @ Override
264270 public void run () {
265271 this .managerThread = Thread .currentThread ();
266272 Log .writeLog (this , this .toString (), "hub manager thread started" );
267273
268274 while (!this .managerThreadStopped ) {
269- Log .writeLog (this , this .toString (),"start a new round" );
275+ Log .writeLog (this , this .toString (),"start a new sync round" );
270276
277+ this .lastSyncStatusWithConnectedHubs = System .currentTimeMillis ();
271278 for (HubConnector hubConnector : this .hubConnectors ) {
272279 Log .writeLog (this , this .toString (), "check hub connection" );
273280 hubConnector .addStatusListener (this );
@@ -288,7 +295,7 @@ public void run() {
288295 Thread .sleep (sleepingTime );
289296 } catch (InterruptedException e ) {
290297 if (!this .managerThreadStopped ) {
291- Log .writeLog (this , this .toString (), "interrupted - make next round earlier " );
298+ Log .writeLog (this , this .toString (), "interrupted - make next sync round now " );
292299 }
293300 }
294301 }
0 commit comments