feign.Feign.newInstance()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(253)

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

Feign.newInstance介绍

[英]Returns a new instance of an HTTP API, defined by annotations in the Feign, for the specified target. You should cache this result.
[中]返回指定目标的HTTP API的新实例,该实例由外部注释定义。您应该缓存此结果。

代码示例

代码示例来源:origin: com.netflix.denominator/denominator-clouddns

@Provides
@Singleton
CloudDNS cloudDNS(Feign feign, CloudDNSTarget target) {
 return feign.newInstance(target);
}

代码示例来源:origin: io.github.openfeign/feign-hystrix

/**
 * @see #target(Class, String, FallbackFactory)
 */
public <T> T target(Target<T> target, FallbackFactory<? extends T> fallbackFactory) {
 return build(fallbackFactory).newInstance(target);
}

代码示例来源:origin: com.netflix.denominator/denominator-clouddns

@Provides
@Singleton
CloudIdentity cloudIdentity(Feign feign) {
 return feign.newInstance(EmptyTarget.create(CloudIdentity.class, "cloudidentity"));
}

代码示例来源:origin: com.netflix.feign/feign-core

public <T> T target(Target<T> target) {
 return build().newInstance(target);
}

代码示例来源:origin: io.github.openfeign/feign-hystrix

/**
 * @see #target(Class, String, Object)
 */
public <T> T target(Target<T> target, T fallback) {
 return build(fallback != null ? new FallbackFactory.Default<T>(fallback) : null)
   .newInstance(target);
}

相关文章