Interface IRemotingClockFactory<K>

Type Parameters:
K - 远端键类型
All Known Implementing Classes:
AbstractRemotingClockFactory

public interface IRemotingClockFactory<K>
远端时钟工厂接口
Author:
wangliang181230
See Also:
  • Method Details

    • getRemotingTime

      @NonNull long getRemotingTime(@NonNull K remotingKey)
      获取远端时间,单位:毫秒
      Parameters:
      remotingKey - 远端键值
      Returns:
      远端时间
    • createClock

      @NonNull default IAutoRefreshTickClock createClock(@NonNull K remotingKey)
      创建远端时钟

      为了使记号时钟的时间误差更小,使用此方法来获取远端时钟

      Parameters:
      remotingKey - 远端键值
      Returns:
      时钟
    • getClock

      @NonNull IAutoRefreshTickClock getClock(@NonNull K remotingKey)
      获取远端时钟
      Parameters:
      remotingKey - 远端健值
      Returns:
      时钟
    • destroyClock

      void destroyClock(@NonNull K remotingKey)
      销毁远端时钟
      Parameters:
      remotingKey - 远端键值
    • now

      @NonNull default Date now(@NonNull K remotingKey)
      远端的当前时间
      Parameters:
      remotingKey - 远端键值
      Returns:
      now 当前时间
    • currentTimeMillis

      default long currentTimeMillis(@NonNull K remotingKey)
      远端的当前毫秒数
      Parameters:
      remotingKey - 远端键值
      Returns:
      timeMillis 毫秒数
    • currentTimeMicros

      default long currentTimeMicros(@NonNull K remotingKey)
      远端的当前微秒数
      Parameters:
      remotingKey - 远端键值
      Returns:
      timeMicros 微秒数
    • currentTimeNanos

      default long currentTimeNanos(@NonNull K remotingKey)
      远端的当前纳秒数
      注意:值格式与 System.nanoTime() 并不相同
      Parameters:
      remotingKey - 远端键值
      Returns:
      timeNanos 纳秒数