org.apache.qpid.test.framework.clocksynch
Class LocalClockSynchronizer

java.lang.Object
  extended by org.apache.qpid.test.framework.clocksynch.LocalClockSynchronizer
All Implemented Interfaces:
ClockSynchronizer

public class LocalClockSynchronizer
extends Object
implements ClockSynchronizer

LocalClockSynchronizer is a fake ClockSynchronizer that simply calls System.nanoTime(). It exists so that the same tests can be run distributed or locally, taking timings against the ClockSynchronizer interface without being aware of how they are being run.

CRC Card
Responsibilities Collaborations
Supply the local clock with no delta.


Constructor Summary
LocalClockSynchronizer()
           
 
Method Summary
 long getDelta()
          Gets the clock delta in nano seconds.
 long getEpsilon()
          Gets an estimate of the clock error in nan seconds.
 long nanoTime()
          Gets the local clock time with any computed delta added in.
 void synch()
          The slave side should call this to copute a clock delta with the reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalClockSynchronizer

public LocalClockSynchronizer()
Method Detail

synch

public void synch()
           throws ClockSynchFailureException
The slave side should call this to copute a clock delta with the reference.

Specified by:
synch in interface ClockSynchronizer
Throws:
ClockSynchFailureException - If synchronization cannot be achieved.

getDelta

public long getDelta()
Gets the clock delta in nano seconds.

Specified by:
getDelta in interface ClockSynchronizer
Returns:
The clock delta in nano seconds.

getEpsilon

public long getEpsilon()
Gets an estimate of the clock error in nan seconds.

Specified by:
getEpsilon in interface ClockSynchronizer
Returns:
An estimate of the clock error in nan seconds.

nanoTime

public long nanoTime()
Gets the local clock time with any computed delta added in.

Specified by:
nanoTime in interface ClockSynchronizer
Returns:
The local clock time with any computed delta added in.


Licensed to the Apache Software Foundation