Package org.apache.camel.clock
Interface Clock
- All Known Subinterfaces:
EventClock<T>
- All Known Implementing Classes:
ContextClock
public interface Clock
A clock abstraction used to track pass of time
-
Method Summary
Modifier and TypeMethodDescriptiondefault Date
asDate()
Get the creation date/time as regular Java Date instancedefault Duration
Get the elapsed duration for this clock in the standard Java Durationdefault ZonedDateTime
Get the creation date/time as with time-zone informationlong
elapsed()
The elapsed time since the creation of the clocklong
The point in time the clock was created
-
Method Details
-
elapsed
long elapsed()The elapsed time since the creation of the clock- Returns:
- The elapsed time, in milliseconds, since the creation of the exchange
-
getCreated
long getCreated()The point in time the clock was created- Returns:
- The point in time, in milliseconds, the exchange was created.
- See Also:
-
asZonedCreationDateTime
Get the creation date/time as with time-zone information- Returns:
- A ZonedDateTime instance from the computed creation time
-
asDate
Get the creation date/time as regular Java Date instance- Returns:
- A Date instance from the computed creation time
-
asDuration
Get the elapsed duration for this clock in the standard Java Duration- Returns:
- A new Duration instance representing the elapsed duration for this clock
-