public class TestTimeServiceProvider extends TimeServiceProvider
TimeServiceProvider
used strictly for testing the
processing time functionality.Constructor and Description |
---|
TestTimeServiceProvider() |
Modifier and Type | Method and Description |
---|---|
long |
getCurrentProcessingTime()
Returns the current processing time.
|
int |
getNoOfRegisteredTimers() |
ScheduledFuture<?> |
registerTimer(long timestamp,
Runnable target)
Registers a task to be executed when (processing) time is
timestamp . |
void |
setCurrentTime(long timestamp) |
void |
shutdownService()
Shuts down and clean up the timer service provider.
|
public void setCurrentTime(long timestamp)
public long getCurrentProcessingTime()
TimeServiceProvider
getCurrentProcessingTime
in class TimeServiceProvider
public ScheduledFuture<?> registerTimer(long timestamp, Runnable target)
TimeServiceProvider
timestamp
.registerTimer
in class TimeServiceProvider
timestamp
- when the task is to be executed (in processing time)target
- the task to be executedpublic int getNoOfRegisteredTimers()
public void shutdownService() throws Exception
TimeServiceProvider
shutdownService
in class TimeServiceProvider
Exception
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.