org.skife.config.TimeSpan.getUnit()方法的使用及代码示例

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

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

TimeSpan.getUnit介绍

暂无

代码示例

代码示例来源: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: 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.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.nesscomputing.components/ness-jms

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

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

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

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

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

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

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

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

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

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

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: org.kill-bill.billing/killbill-util

@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-payment

@Inject
public PaymentProcessor(final OSGIServiceRegistration<PaymentPluginApi> pluginRegistry,
            final PaymentMethodProcessor paymentMethodProcessor,
            final AccountInternalApi accountUserApi,
            final InvoiceInternalApi invoiceApi,
            final TagInternalApi tagUserApi,
            final FailedPaymentRetryServiceScheduler failedPaymentRetryService,
            final PluginFailureRetryServiceScheduler pluginFailureRetryService,
            final AutoPayRetryServiceScheduler autoPayoffRetryService,
            final PaymentDao paymentDao,
            final NonEntityDao nonEntityDao,
            final PersistentBus eventBus,
            final Clock clock,
            final GlobalLocker locker,
            final PaymentConfig paymentConfig,
            @Named(PLUGIN_EXECUTOR_NAMED) final ExecutorService executor) {
  super(pluginRegistry, accountUserApi, eventBus, paymentDao, nonEntityDao, tagUserApi, locker, executor, invoiceApi);
  this.paymentMethodProcessor = paymentMethodProcessor;
  this.failedPaymentRetryService = failedPaymentRetryService;
  this.pluginFailureRetryService = pluginFailureRetryService;
  this.autoPayoffRetryService = autoPayoffRetryService;
  this.clock = clock;
  this.paymentConfig = paymentConfig;
  final long paymentPluginTimeoutSec = TimeUnit.SECONDS.convert(paymentConfig.getPaymentPluginTimeout().getPeriod(), paymentConfig.getPaymentPluginTimeout().getUnit());
  this.paymentPluginDispatcher = new PluginDispatcher<Payment>(paymentPluginTimeoutSec, executor);
  this.voidPluginDispatcher = new PluginDispatcher<Void>(paymentPluginTimeoutSec, executor);
}

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

@Override
protected boolean process() throws IOException, InterruptedException
{
  // Only connect the transmitter if lazy-connect is false.
  if (!getConfig().isLazyTransmitterConnect()) {
    channelConnect();
  }
  final T data = messageQueue.poll(tickTimeout.getPeriod(), tickTimeout.getUnit());
  if (data != null) {
    final PublisherData publisherData = publisherCallback.publish(data);
    if (publisherData != null) {
      publish(publisherData);
      return getChannel().isOpen() && publisherData.isHealthy();
    }
  }
  return true;
}

代码示例来源:origin: com.ning.jetty/ning-service-skeleton-jdbi

dbConfig.setMinConnectionsPerPartition(config.getMinIdle());
dbConfig.setMaxConnectionsPerPartition(config.getMaxActive());
dbConfig.setConnectionTimeout(config.getConnectionTimeout().getPeriod(), config.getConnectionTimeout().getUnit());
dbConfig.setIdleMaxAge(config.getIdleMaxAge().getPeriod(), config.getIdleMaxAge().getUnit());
dbConfig.setMaxConnectionAge(config.getMaxConnectionAge().getPeriod(), config.getMaxConnectionAge().getUnit());
dbConfig.setIdleConnectionTestPeriod(config.getIdleConnectionTestPeriod().getPeriod(), config.getIdleConnectionTestPeriod().getUnit());
dbConfig.setPartitionCount(1);
dbConfig.setDefaultTransactionIsolation("READ_COMMITTED");

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

private DataSource getBoneCPDatSource() {
  final BoneCPConfig dbConfig = new BoneCPConfig();
  dbConfig.setJdbcUrl(config.getJdbcUrl());
  dbConfig.setUsername(config.getUsername());
  dbConfig.setPassword(config.getPassword());
  dbConfig.setMinConnectionsPerPartition(config.getMinIdle());
  dbConfig.setMaxConnectionsPerPartition(config.getMaxActive());
  dbConfig.setConnectionTimeout(config.getConnectionTimeout().getPeriod(), config.getConnectionTimeout().getUnit());
  /*
  dbConfig.setIdleMaxAge(config.getIdleMaxAge().getPeriod(), config.getIdleMaxAge().getUnit());
  dbConfig.setMaxConnectionAge(config.getMaxConnectionAge().getPeriod(), config.getMaxConnectionAge().getUnit());
  dbConfig.setIdleConnectionTestPeriod(config.getIdleConnectionTestPeriod().getPeriod(), config.getIdleConnectionTestPeriod().getUnit());
  */
  dbConfig.setPartitionCount(1);
  dbConfig.setDisableJMX(false);
  return new BoneCPDataSource(dbConfig);
}

相关文章