private <T> ProtocolInvoker<T> createProtocolInvoker(Class<T> api, ServantProxyConfig servantProxyConfig) throws ClientException { ProtocolInvoker<T> protocolInvoker = null; Codec codec = createCodec(api, servantProxyConfig); if (api.isAnnotationPresent(Servant.class)) { if (codec == null) { codec = new TarsCodec(servantProxyConfig.getCharsetName()); } servantProxyConfig.setProtocol(codec.getProtocol()); protocolInvoker = new TarsProtocolInvoker<T>(api, servantProxyConfig, new ServantProtocolFactory(codec), communicator.getThreadPoolExecutor()); } else { throw new ClientException(servantProxyConfig.getSimpleObjectName(), "unkonw protocol servant invoker", null); } return protocolInvoker; }
private <T> ProtocolInvoker<T> createProtocolInvoker(Class<T> api, ServantProxyConfig servantProxyConfig) throws ClientException { ProtocolInvoker<T> protocolInvoker = null; Codec codec = createCodec(api, servantProxyConfig); if (api.isAnnotationPresent(Servant.class)) { if (codec == null) { codec = new TarsCodec(servantProxyConfig.getCharsetName()); } servantProxyConfig.setProtocol(codec.getProtocol()); protocolInvoker = new TarsProtocolInvoker<T>(api, servantProxyConfig, new ServantProtocolFactory(codec), communicator.getThreadPoolExecutor()); } else { throw new ClientException(servantProxyConfig.getSimpleObjectName(), "unkonw protocol servant invoker", null); } return protocolInvoker; }
private <T> ProtocolInvoker<T> createProtocolInvoker(Class<T> api, ServantProxyConfig servantProxyConfig) throws ClientException { ProtocolInvoker<T> protocolInvoker = null; Codec codec = createCodec(api, servantProxyConfig); if (api.isAnnotationPresent(Servant.class)) { if (codec == null) { codec = new TarsCodec(servantProxyConfig.getCharsetName()); } servantProxyConfig.setProtocol(codec.getProtocol()); protocolInvoker = new TarsProtocolInvoker<T>(api, servantProxyConfig, new ServantProtocolFactory(codec), communicator.getThreadPoolExecutor()); } else { throw new ClientException(servantProxyConfig.getSimpleObjectName(), "unkonw protocol servant invoker", null); } return protocolInvoker; }