public TimeUnit getClockResolution() {
// The ClockResolution class in Hector is quite lame.
// No equals() or any way to actually query it to find out
// its resolution other than its class
ClockResolution clockResolution = hostConfigurator.getClockResolution();
if ((clockResolution instanceof MicrosecondsClockResolution)
|| (clockResolution instanceof MicrosecondsSyncClockResolution)) {
return TimeUnit.MICROSECONDS;
}
if (clockResolution instanceof MillisecondsClockResolution) {
return TimeUnit.MILLISECONDS;
}
if (clockResolution instanceof SecondsClockResolution) {
return TimeUnit.SECONDS;
}
throw new AssertionError("Unexpected implementation class for clockResolution: "
+ clockResolution.getClass().getName());
}