public interface TimeService
| Modifier and Type | Method and Description | 
|---|---|
void | 
advanceBy(long timeAdvance,
         java.util.concurrent.TimeUnit timeUnit)
Advances the service time by a certain number of time units in the future. 
 | 
void | 
advanceTo(long targetTimeMsec)
Make the service advance to a specific time in the future 
 | 
Timestamp | 
getFutureTimestamp(long targetAdvance,
                  java.util.concurrent.TimeUnit timeUnit)
Get the time stamp of a time point based on the specific time advance 
 | 
long | 
getTargetTime()
Get the current time in milliseconds from the perspective of this time service 
 | 
long getTargetTime()
void advanceBy(long timeAdvance,
               java.util.concurrent.TimeUnit timeUnit)
        throws StreamBaseException
timeAdvance - number of time units that the service should advance by. It should be a positive long valuetimeUnit - time unitStreamBaseExceptionvoid advanceTo(long targetTimeMsec)
        throws StreamBaseException
targetTimeMsec - Time to advance to. It must be greater than the service's current timeStreamBaseExceptionTimestamp getFutureTimestamp(long targetAdvance, java.util.concurrent.TimeUnit timeUnit)
targetAdvance - time difference (in time units) between the future time point and the service's current time
          It must be 0 or a positive valuetimeUnit - time unit