本文整理了Java中feign.Feign.newInstance()
方法的一些代码示例,展示了Feign.newInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feign.newInstance()
方法的具体详情如下:
包路径:feign.Feign
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!