io.micronaut.inject.qualifiers.Qualifiers.byQualifiers()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(90)

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

Qualifiers.byQualifiers介绍

[英]Build a qualifier from other qualifiers.
[中]从其他限定符生成限定符。

代码示例

代码示例来源:origin: io.micronaut/inject

@Override
@SuppressWarnings("unchecked")
public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(Class<T> beanType, Qualifier<T> qualifier) {
  Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
  BeanKey key = new BeanKey(beanType, proxyQualifier);
  return (Optional) beanConcreteCandidateCache.get(key, beanKey -> {
    BeanRegistration<T> beanRegistration = singletonObjects.get(beanKey);
    if (beanRegistration != null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Resolved existing bean [{}] for type [{}] and qualifier [{}]", beanRegistration.bean, beanType, qualifier);
      }
      return Optional.of(beanRegistration.beanDefinition);
    }
    return findConcreteCandidateNoCache((Class) beanType, qualifier, true, false, false);
  });
}

代码示例来源:origin: io.micronaut/micronaut-inject

@Override
@SuppressWarnings("unchecked")
public <T> Optional<BeanDefinition<T>> findProxyTargetBeanDefinition(Class<T> beanType, Qualifier<T> qualifier) {
  Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
  BeanKey key = new BeanKey(beanType, proxyQualifier);
  return (Optional) beanConcreteCandidateCache.get(key, beanKey -> {
    BeanRegistration<T> beanRegistration = singletonObjects.get(beanKey);
    if (beanRegistration != null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("Resolved existing bean [{}] for type [{}] and qualifier [{}]", beanRegistration.bean, beanType, qualifier);
      }
      return Optional.of(beanRegistration.beanDefinition);
    }
    return findConcreteCandidateNoCache((Class) beanType, qualifier, true, false, false);
  });
}

代码示例来源:origin: io.micronaut/inject

@SuppressWarnings("unchecked")
@Override
public <T> T getProxyTargetBean(Class<T> beanType, Qualifier<T> qualifier) {
  Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
  BeanDefinition<T> definition = getProxyTargetBeanDefinition(beanType, qualifier);
  return getBeanForDefinition(new DefaultBeanResolutionContext(this, definition), beanType, proxyQualifier, true, definition);
}

代码示例来源:origin: io.micronaut/micronaut-inject

@SuppressWarnings("unchecked")
@Override
public <T> T getProxyTargetBean(Class<T> beanType, Qualifier<T> qualifier) {
  Qualifier<T> proxyQualifier = qualifier != null ? Qualifiers.byQualifiers(qualifier, PROXY_TARGET_QUALIFIER) : PROXY_TARGET_QUALIFIER;
  BeanDefinition<T> definition = getProxyTargetBeanDefinition(beanType, qualifier);
  return getBeanForDefinition(new DefaultBeanResolutionContext(this, definition), beanType, proxyQualifier, true, definition);
}

相关文章