Package com.iizix.timeout
Interface ITimerTask
- All Known Subinterfaces:
- ITimeoutTask
- All Known Implementing Classes:
- TimeoutTask
public interface ITimerTask
Base interface for registered timeout or scheduled task that can be queried for timeout or canceled.
- Author:
- Christopher Mindus
- Method SummaryModifier and TypeMethodDescription- boolean- cancel()Cancels the timeout task.- longGets the starting time.
- Method Details- getStartTimelong getStartTime()Gets the starting time.- Returns the starting time in milliseconds. Note that while the unit of time of the return value is a millisecond, the granularity of the value depends on the underlying operating system and may be larger. For example, many operating systems measure time in units of tens of milliseconds. - See the description of the class - Datefor a discussion of slight discrepancies that may arise between "computer time" and coordinated universal time (UTC).- Returns:
- The difference, measured in milliseconds, between the start time and midnight, January 1, 1970 UTC.
- See Also:
 
- cancelboolean cancel()Cancels the timeout task. This call can be done from any thread and will stop any timeout notification of- ITimeoutListener.onTimeout().- Returns:
- true for success, false if already canceled.