public InviteMsgTimer() { try { dist = Distribution.getDistributionFromConfigFile("Antenna/InviteIntervall"); refreshRate = Configuration.getIntegerParameter("Antenna/refreshRate"); } catch (CorruptConfigurationEntryException e) { Tools.fatalError(e.getMessage()); } }
@Override public void fire() { InviteMessage msg = new InviteMessage(); refreshCounter--; if (refreshCounter <= 0) { ((Antenna) this.node).resetNeighborhood(); msg.requireSubscription = true; refreshCounter = refreshRate; // reset the counter } this.node.broadcast(msg); double time = dist.nextSample(); if (time <= 0) { Tools.fatalError("Invalid offset time for inviteInterval: " + time + " is <= 0."); } this.startRelative(time, this.node); }