本文整理汇总了Java中feign.InvocationHandlerFactory.MethodHandler类的典型用法代码示例。如果您正苦于以下问题:Java MethodHandler类的具体用法?Java MethodHandler怎么用?Java MethodHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MethodHandler类属于feign.InvocationHandlerFactory包,在下文中一共展示了MethodHandler类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: apply
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public Map<String, MethodHandler> apply(Target key) {
List<MethodMetadata> metadata = contract.parseAndValidatateMetadata(key.type());
Map<String, MethodHandler> result = new LinkedHashMap<String, MethodHandler>();
for (MethodMetadata md : metadata) {
BuildTemplateByResolvingArgs buildTemplate;
if (!md.formParams().isEmpty() && md.template().bodyTemplate() == null) {
buildTemplate = new BuildFormEncodedTemplateFromArgs(md, encoder);
} else if (md.bodyIndex() != null) {
buildTemplate = new BuildEncodedTemplateFromArgs(md, encoder);
} else {
buildTemplate = new BuildTemplateByResolvingArgs(md);
}
result.put(md.configKey(),
factory.create(key, md, buildTemplate, options, decoder, errorDecoder));
}
return result;
}
示例2: create
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
MethodHandler create(
final Target<?> target,
final MethodMetadata metadata,
final RequestTemplate.Factory buildTemplateFromArgs,
final HttpClientOptions options,
final Decoder decoder,
final ErrorDecoder errorDecoder) {
return new AsynchronousMethodHandler(
target,
client,
retryer,
requestInterceptors,
logger,
logLevel,
metadata,
buildTemplateFromArgs,
options,
decoder,
errorDecoder,
decode404);
}
示例3: apply
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
Map<String, MethodHandler> apply(final Target key) {
final List<MethodMetadata> metadata = contract
.parseAndValidatateMetadata(key.type());
final Map<String, MethodHandler> result = new LinkedHashMap<>();
for (final MethodMetadata md : metadata) {
BuildTemplateByResolvingArgs buildTemplate;
if (!md.formParams().isEmpty()
&& md.template().bodyTemplate() == null) {
buildTemplate = new BuildTemplateByResolvingArgs
.BuildFormEncodedTemplateFromArgs(md, encoder);
} else if (md.bodyIndex() != null) {
buildTemplate = new BuildTemplateByResolvingArgs
.BuildEncodedTemplateFromArgs(md, encoder);
} else {
buildTemplate = new BuildTemplateByResolvingArgs(md);
}
result.put(md.configKey(), factory.create(
key, md, buildTemplate, options, decoder, errorDecoder));
}
return result;
}
示例4: HystrixInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
HystrixInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
SetterFactory setterFactory, FallbackFactory<?> fallbackFactory) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch");
this.fallbackFactory = fallbackFactory;
this.fallbackMethodMap = toFallbackMethod(dispatch);
this.setterMethodMap = toSetters(setterFactory, target, dispatch.keySet());
}
示例5: create
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public MethodHandler create(Target<?> target, MethodMetadata md,
RequestTemplate.Factory buildTemplateFromArgs,
Options options, Decoder decoder, ErrorDecoder errorDecoder) {
return new SynchronousMethodHandler(target, client, retryer, requestInterceptors, logger,
logLevel, md, buildTemplateFromArgs, options, decoder,
errorDecoder, decode404);
}
示例6: CompletableInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
CompletableInvocationHandler(final Target<?> target, final Map<Method, MethodHandler> dispatch,
final FutureMethodCallFactory futureFactory, final Executor executor) {
this.target = target;
this.dispatch = dispatch;
this.futureFactory = futureFactory;
this.executor = executor;
}
示例7: EnhanceInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public EnhanceInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch,
SetterFactory setterFactory, FallbackFactory<?> fallbackFactory) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch");
this.fallbackFactory = fallbackFactory;
this.fallbackMethodMap = toFallbackMethod(dispatch);
this.setterMethodMap = toSetters(setterFactory, target, dispatch.keySet());
}
示例8: setHandlers
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public void setHandlers(Map<Method, MethodHandler> handlers) {
this.handlers = handlers;
}
示例9: FeignInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
FeignInvocationHandler(Target target, Map<Method, MethodHandler> dispatch) {
this.target = checkNotNull(target, "target");
this.dispatch = checkNotNull(dispatch, "dispatch for %s", target);
}
示例10: VertxInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
private VertxInvocationHandler(final Target<?> target,
final Map<Method, MethodHandler> dispatch) {
this.target = checkNotNull(target, "target must not be null");
this.dispatch = checkNotNull(dispatch, "dispatch must not be null");
}
示例11: create
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
@Override
public InvocationHandler create(final Target target,
final Map<Method, MethodHandler> dispatch) {
return new VertxInvocationHandler(target, dispatch);
}
示例12: ReactorInvocationHandler
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
ReactorInvocationHandler(Target<?> target, Map<Method, MethodHandler> dispatch) {
this.target = requireNonNull(target, "target");
this.dispatch = requireNonNull(dispatch, "dispatch");
}
示例13: getHandlers
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public Map<Method, MethodHandler> getHandlers() {
return handlers;
}
示例14: setHandlers
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
public void setHandlers(Map<Method, MethodHandler> handlers) {
this.handlers = handlers;
}
示例15: toFallbackMethod
import feign.InvocationHandlerFactory.MethodHandler; //导入依赖的package包/类
/**
* If the method param of InvocationHandler.invoke is not accessible, i.e in a package-private
* interface, the fallback call in hystrix command will fail cause of access restrictions. But
* methods in dispatch are copied methods. So setting access to dispatch method doesn't take
* effect to the method in InvocationHandler.invoke. Use map to store a copy of method to invoke
* the fallback to bypass this and reducing the count of reflection calls.
*
* @return cached methods map for fallback invoking
*/
static Map<Method, Method> toFallbackMethod(Map<Method, MethodHandler> dispatch) {
Map<Method, Method> result = new LinkedHashMap<Method, Method>();
for (Method method : dispatch.keySet()) {
method.setAccessible(true);
result.put(method, method);
}
return result;
}