當前位置: 首頁>>代碼示例>>Java>>正文


Java Injector.getParent方法代碼示例

本文整理匯總了Java中com.google.inject.Injector.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java Injector.getParent方法的具體用法?Java Injector.getParent怎麽用?Java Injector.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.inject.Injector的用法示例。


在下文中一共展示了Injector.getParent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addJaxrsClasses

import com.google.inject.Injector; //導入方法依賴的package包/類
private void addJaxrsClasses(Injector injector, List<Class<?>> classes) {
  for (Key<?> key : injector.getBindings().keySet()) {
    Class<?> clazz = key.getTypeLiteral().getRawType();
    if (hasPathAnnotation(clazz)) {
      classes.add(clazz);
    }
  }

  while (injector.getParent() != null) {
    injector = injector.getParent();
    addJaxrsClasses(injector, classes);
  }
}
 
開發者ID:cerner,項目名稱:beadledom,代碼行數:14,代碼來源:SwaggerGuiceJaxrsScanner.java

示例2: get

import com.google.inject.Injector; //導入方法依賴的package包/類
@Override
public BeadledomClientBuilder get() {
  Optional<BeadledomClientConfiguration> beadledomClientConfigOpt = beadledomConfigProvider.get(
      clientBindingAnnotation);
  BeadledomClientBuilder clientBuilder =
      clientBuilderFactoryProvider.get(clientBindingAnnotation).create();
  clientBuilder.setCorrelationIdName(correlationIdHeader);
  if (beadledomClientConfigOpt.isPresent()) {
    // When there is custom client config
    BeadledomClientConfiguration config = beadledomClientConfigOpt.get();

    if (config.correlationIdName() != null) {
      clientBuilder.setCorrelationIdName(config.correlationIdName());
    }

    clientBuilder.setConnectionPoolSize(config.connectionPoolSize());
    clientBuilder.setMaxPooledPerRouteSize(config.maxPooledPerRouteSize());
    clientBuilder.setSocketTimeout(config.socketTimeoutMillis(), TimeUnit.SECONDS);
    clientBuilder.setConnectionTimeout(config.connectionTimeoutMillis(), TimeUnit.SECONDS);
    clientBuilder.setTtl(config.ttlMillis(), TimeUnit.SECONDS);

    if (config.sslContext() != null) {
      clientBuilder.sslContext(config.sslContext());
    }
    if (config.trustStore() != null) {
      clientBuilder.trustStore(config.trustStore());
    }
  }

  Injector tempInjector = getInjector();
  processInjector(tempInjector, clientBuilder);
  while (tempInjector.getParent() != null) {
    tempInjector = tempInjector.getParent();
    processInjector(tempInjector, clientBuilder);
  }
  return clientBuilder;
}
 
開發者ID:cerner,項目名稱:beadledom,代碼行數:38,代碼來源:BeadledomClientBuilderProvider.java

示例3: forEachBinding

import com.google.inject.Injector; //導入方法依賴的package包/類
public static void forEachBinding(Injector injector, Consumer<? super Binding<?>> consumer) {
    while(injector != null) {
        injector.getBindings().forEach((key, binding) -> consumer.accept(binding));
        injector = injector.getParent();
    }
}
 
開發者ID:OvercastNetwork,項目名稱:ProjectAres,代碼行數:7,代碼來源:Injection.java


注:本文中的com.google.inject.Injector.getParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。