peer2me.network
Class NetworkTimer

java.lang.Object
  extended by java.util.TimerTask
      extended by peer2me.network.NetworkTimer
All Implemented Interfaces:
java.lang.Runnable

public class NetworkTimer
extends java.util.TimerTask

This class is a timer ticking at the given rate, starting after a given delay. The purpose of this class is to aid the ping-functionality.

Author:
Tommy Bjoernsgaard

Constructor Summary
NetworkTimer(Network network, long rate)
          Creating a new timer with a reference to Network.
 
Method Summary
 void run()
          The method required from TimerTask which it called at det given rate.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkTimer

public NetworkTimer(Network network,
                    long rate)
Creating a new timer with a reference to Network. It also starts the timer with the given rate.

Parameters:
network - a reference to Network
rate - the "ping-rate"
Method Detail

run

public void run()
The method required from TimerTask which it called at det given rate. Calls on Network.ping().

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask