use of com.szmirren.vxApi.spi.customHandler.VxApiCustomHandlerOptions in project VX-API-Gateway by EliMirren.
the class VxApiApplication method serverCustomTypeHandler.
/**
* 自定义服务类型处理器
*
* @param isNext
* @param api
* @param route
* @throws Exception
*/
public void serverCustomTypeHandler(boolean isNext, VxApis api, Route route) throws Exception {
JsonObject body = api.getServerEntrance().getBody();
VxApiCustomHandlerOptions options = VxApiCustomHandlerOptions.fromJson(body);
if (options == null) {
throw new NullPointerException("自定义服务类型的配置文件无法装换为服务类");
}
if (body.getValue("isNext") == null) {
body.put("isNext", isNext);
}
options.setOption(body);
VxApiCustomHandler customHandler = VxApiCustomHandlerFactory.getCustomHandler(options.getInFactoryName(), options.getOption(), api, httpClient);
route.handler(customHandler);
}
Aggregations