org.skife.config.TimeSpan类的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.skife.config.TimeSpan类的一些代码示例,展示了TimeSpan类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TimeSpan类的具体详情如下:
包路径:org.skife.config.TimeSpan
类名称:TimeSpan

TimeSpan介绍

暂无

代码示例

代码示例来源:origin: killbill/killbill

@Override
  public SessionDAO get() {
    final CachingSessionDAO sessionDao;
    if (redisCacheConfig.isRedisCachingEnabled()) {
      sessionDao = new RedisSessionDao();
    } else {
      sessionDao = new JDBCSessionDao(dbi, roDbi);
    }

    if (sessionManager instanceof DefaultSessionManager) {
      final DefaultSessionManager defaultSessionManager = (DefaultSessionManager) sessionManager;
      defaultSessionManager.setSessionDAO(sessionDao);
      defaultSessionManager.setGlobalSessionTimeout(rbacConfig.getGlobalSessionTimeout().getMillis());
    }

    return sessionDao;
  }
}

代码示例来源:origin: killbill/killbill

@Override
  public TimeSpan apply(final String input) {
    return new TimeSpan(input);
  }
};

代码示例来源:origin: killbill/killbill

public void start() {
  final TimeUnit pendingRateUnit = tenantConfig.getTenantBroadcastServiceRunningRate().getUnit();
  final long pendingPeriod = tenantConfig.getTenantBroadcastServiceRunningRate().getPeriod();
  tenantExecutor.scheduleAtFixedRate(new TenantCacheInvalidationRunnable(this, broadcastDao, tenantDao), pendingPeriod, pendingPeriod, pendingRateUnit);
}

代码示例来源:origin: com.fasterxml.clustermate/clustermate-service

@Override
protected void init(SharedServiceStuff stuff,
    Stores<?,?> stores,
    ClusterViewByServer cluster,
    AtomicBoolean shutdown)
{
  super.init(stuff, stores, cluster, shutdown);
  _fileManager = stuff.getFileManager();
  // let's use max-TTL-plus-one-day 
  _maxTimeToLiveMsecs = stuff.getServiceConfig().cfgMaxMaxTTL.getMillis()
      + new TimeSpan("1d").getMillis();
}

代码示例来源:origin: org.kill-bill.commons/killbill-queue

private long getReapThreshold() {
    final long threshold;
    // if Claim time is greater than reap threshold
    if (config.getClaimedTime().getMillis() >= config.getReapThreshold().getMillis()) {
      // override reap threshold using claim time + 5 minutes
      threshold = config.getClaimedTime().getMillis() + FIVE_MINUTES;
      log.warn("{}: Reap threshold was mis-configured. Claim time [{}] is greater than reap threshold [{}]",
                  threadScheduledExecutorName, config.getClaimedTime().toString(), config.getReapThreshold().toString());

    } else {
      threshold = config.getReapThreshold().getMillis();
    }

    return threshold;
  }
}

代码示例来源:origin: stackoverflow.com

string span = "P18DT5H";

IFormatProvider formatProvider = System.Globalization.CultureInfo.InvariantCulture;
TimeSpan timeSpan = TimeSpan.ParseExact(span, "'P'd'DT'h'H'", formatProvider);

int hours = (int)Math.Floor(timeSpan.TotalHours);
int minutes = (int)Math.Round(timeSpan.Subtract(new TimeSpan(hours, 0, 0)).TotalMinutes, 0, MidpointRounding.AwayFromZero);

Console.WriteLine("{0} hours, {1} minutes", hours, minutes);

代码示例来源:origin: org.kill-bill.commons/killbill-queue

Date reapingDate = clock.getUTCNow().minusMinutes((int) config.getReapThreshold().getPeriod()).toDate();
queue.reapEntries(reapingDate);

代码示例来源:origin: org.kill-bill.commons/killbill-queue

Date reapingDate = clock.getUTCNow().minusMinutes((int) config.getReapThreshold().getPeriod()).toDate();
queue.reapEntries(reapingDate);

代码示例来源:origin: com.fasterxml.clustermate/clustermate-service

public DeferredDeleteConfig(int minQueueLength, int maxQueueLength,
      TimeSpan queueTargetDelayMsecs, TimeSpan queueMaxDelayMsecs)
  {
    if (minQueueLength > maxQueueLength) {
      throw new IllegalArgumentException("minQueueLength ("+minQueueLength+") can not exceed maxQueueLength ("+maxQueueLength+")");
    }
    this.minQueueLength = minQueueLength;
    this.maxQueueLength = maxQueueLength;
    if (queueTargetDelayMsecs.getMillis() > queueMaxDelayMsecs.getMillis()) {
      throw new IllegalArgumentException("queueTargetDelayMsecs ("+queueTargetDelayMsecs+") can not exceed queueMaxDelayMsecs ("+queueMaxDelayMsecs+")");
    }
    this.queueTargetDelayMsecs = queueTargetDelayMsecs;
    this.queueMaxDelayMsecs = queueMaxDelayMsecs;
  }
}

代码示例来源:origin: stackoverflow.com

WebDriver _driver = new WebDriver();
WebDriverWait _wait = new WebDriverWait(_driver, new TimeSpan(0, 1, 0));

_wait.Until(d => d.FindElement(By.Id("Id_Your_UIElement"));

代码示例来源:origin: killbill/killbill

@LifecycleHandlerType(LifecycleHandlerType.LifecycleLevel.START_SERVICE)
public void start() {
  final TimeUnit pendingRateUnit = broadcastConfig.getBroadcastServiceRunningRate().getUnit();
  final long pendingPeriod = broadcastConfig.getBroadcastServiceRunningRate().getPeriod();
  broadcastExecutor.scheduleAtFixedRate(new BroadcastServiceRunnable(this, broadcastDao, eventBus), pendingPeriod, pendingPeriod, pendingRateUnit);
}

代码示例来源:origin: com.ning.billing/killbill-meter

public void startPurgeThread() {
  purgeThread.scheduleWithFixedDelay(new Runnable() {
    @Override
    public void run() {
      purgeFilesAndAccumulators();
    }
  }, config.getTimelineLength().getMillis(),
                    config.getTimelineLength().getMillis(),
                    TimeUnit.MILLISECONDS);
}

代码示例来源:origin: stackoverflow.com

protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
  DateTime input = Calendar1.SelectedDate;
  int delta = DayOfWeek.Sunday - input.DayOfWeek;
  DateTime firstDay = input.AddDays(delta);

  for (int i = 0; i < 7; i++)
   Label1.Text += ((DateTime)(firstDay.Add(new TimeSpan(i, 0, 0, 0)))).ToShortDateString() + " -- ";
}

代码示例来源:origin: com.nesscomputing.components/ness-amqp

public boolean offerWithTimeout(@Nonnull final T data)
{
  Preconditions.checkNotNull(data, "the message can not be null!");
  try {
    return messageQueue.offer(data, transmitTimeout.getPeriod(), transmitTimeout.getUnit());
  }
  catch (InterruptedException ie) {
    Thread.currentThread().interrupt();
    return false;
  }
}

代码示例来源:origin: com.ning.billing/killbill-meter

public void runAggregationThread() {
  aggregatorThread.scheduleWithFixedDelay(new Runnable() {
    @Override
    public void run() {
      getAndProcessTimelineAggregationCandidates();
    }
  },
                      config.getAggregationInterval().getMillis(),
                      config.getAggregationInterval().getMillis(),
                      TimeUnit.MILLISECONDS);
}

代码示例来源:origin: com.fasterxml.clustermate/clustermate-service

public DeferredDeleteConfig() {
    this(5, 100, DEFAULT_TARGET_DELAY,
        new TimeSpan(2500, TimeUnit.MILLISECONDS)
        // !!! TEST
//        new TimeSpan(1000, TimeUnit.MILLISECONDS)
      );
  }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi

private int toMilliSeconds(final TimeSpan timeSpan) {
  return toMilliSeconds(timeSpan.getPeriod(), timeSpan.getUnit());
}

代码示例来源:origin: com.nesscomputing.service.discovery/discovery-client

ServiceDiscoveryReader(final DiscoveryClientConfig discoveryConfig,
            final ObjectMapper objectMapper,
            final StateOfTheWorldHolder stateHolder)
{
  super(discoveryConfig, objectMapper);
  this.stateHolder = stateHolder;
  this.penaltyTime = discoveryConfig.getPenaltyTime().getMillis() * 1000000L;
}

代码示例来源:origin: stackoverflow.com

interface ISixty
 {
   DateTime SixtyDaysFromNow();
 }
 public class Foo : ISixty
 {
   public DateTime SixtyDaysFromNow()
   {
     return DateTime.Now + new TimeSpan(60,0,0,0);
   }
 }

代码示例来源:origin: org.kill-bill.billing/killbill-osgi

private int toSeconds(final TimeSpan timeSpan) {
  return toSeconds(timeSpan.getPeriod(), timeSpan.getUnit());
}

相关文章