public class DefaultGtInterceptor extends Object implements GtInterceptor
| 构造器和说明 |
|---|
DefaultGtInterceptor(HostManager hostManager,
BlockingQueue<StateWrapper> reportDataQueue,
GtApiConfiguration configuration) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterCompletion(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
String result)
http请求后调用,不管成功或者失败都会调用
|
StateWrapper |
getAndRemove(String host) |
void |
handleException(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
ApiException e)
报错时调用此方法
|
void |
post(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body,
String result)
http请求成功后调用此方法
|
void |
pre(GtApiProxyFactory.ApiParam apiParam,
Map<String,Object> header,
String body)
http请求前调用
|
public DefaultGtInterceptor(HostManager hostManager, BlockingQueue<StateWrapper> reportDataQueue, GtApiConfiguration configuration)
public void pre(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body)
GtInterceptorpre 在接口中 GtInterceptorapiParam - 请求参数header - 请求headerbody - 请求bodypublic void post(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, String result)
GtInterceptorpost 在接口中 GtInterceptorapiParam - 请求参数header - 请求headerbody - 请求bodyresult - 返回值public void handleException(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, ApiException e)
GtInterceptorhandleException 在接口中 GtInterceptorapiParam - 请求参数header - 请求headerbody - 请求bodye - 异常信息public void afterCompletion(GtApiProxyFactory.ApiParam apiParam, Map<String,Object> header, String body, String result)
GtInterceptorafterCompletion 在接口中 GtInterceptorapiParam - 请求参数header - 请求headerbody - 请求bodyresult - 返回值public StateWrapper getAndRemove(String host)
Copyright © 2022. All rights reserved.