Package icu.easyj.core.clock.factory
Interface IRemotingClockFactory<K>
- Type Parameters:
K- 远端键类型
- All Known Implementing Classes:
AbstractRemotingClockFactory
public interface IRemotingClockFactory<K>
远端时钟工厂接口
- Author:
- wangliang181230
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault IAutoRefreshTickClockcreateClock(K remotingKey) 创建远端时钟default longcurrentTimeMicros(K remotingKey) 远端的当前微秒数default longcurrentTimeMillis(K remotingKey) 远端的当前毫秒数default longcurrentTimeNanos(K remotingKey) 远端的当前纳秒数
注意:值格式与System.nanoTime()并不相同voiddestroyClock(K remotingKey) 销毁远端时钟获取远端时钟longgetRemotingTime(K remotingKey) 获取远端时间,单位:毫秒default Date远端的当前时间
-
Method Details
-
getRemotingTime
获取远端时间,单位:毫秒- Parameters:
remotingKey- 远端键值- Returns:
- 远端时间
-
createClock
创建远端时钟为了使记号时钟的时间误差更小,使用此方法来获取远端时钟
- Parameters:
remotingKey- 远端键值- Returns:
- 时钟
-
getClock
获取远端时钟- Parameters:
remotingKey- 远端健值- Returns:
- 时钟
-
destroyClock
销毁远端时钟- Parameters:
remotingKey- 远端键值
-
now
远端的当前时间- Parameters:
remotingKey- 远端键值- Returns:
- now 当前时间
-
currentTimeMillis
远端的当前毫秒数- Parameters:
remotingKey- 远端键值- Returns:
- timeMillis 毫秒数
-
currentTimeMicros
远端的当前微秒数- Parameters:
remotingKey- 远端键值- Returns:
- timeMicros 微秒数
-
currentTimeNanos
远端的当前纳秒数
注意:值格式与System.nanoTime()并不相同- Parameters:
remotingKey- 远端键值- Returns:
- timeNanos 纳秒数
-