当前位置: 首页>>代码示例>>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;未经允许,请勿转载。