public static <T> ClientInvoker createClientInvoker(Class<T> clazz, Method method, URI baseUri, ProxyConfig config) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (httpMethods == null || httpMethods.size() != 1) { throw new RuntimeException(Messages.MESSAGES.mustUseOneHttpMethod(method.toString())); } ClientInvoker invoker = new ClientInvoker(baseUri, clazz, method, config); invoker.getAttributes().putAll(config.getRequestAttributes()); ClientInvokerInterceptorFactory.applyDefaultInterceptors(invoker, config.getProviderFactory(), clazz, method); invoker.setHttpMethod(httpMethods.iterator().next()); return invoker; } }
public static <T> ClientInvoker createClientInvoker(Class<T> clazz, Method method, URI baseUri, ProxyConfig config) { Set<String> httpMethods = IsHttpMethod.getHttpMethods(method); if (httpMethods == null || httpMethods.size() != 1) { throw new RuntimeException(Messages.MESSAGES.mustUseOneHttpMethod(method.toString())); } ClientInvoker invoker = new ClientInvoker(baseUri, clazz, method, config); invoker.getAttributes().putAll(config.getRequestAttributes()); ClientInvokerInterceptorFactory.applyDefaultInterceptors(invoker, config.getProviderFactory(), clazz, method); invoker.setHttpMethod(httpMethods.iterator().next()); return invoker; } }
public ClientInvoker(URI baseUri, Class declaring, Method method, ProxyConfig config) { this.declaring = declaring; this.method = method; this.marshallers = ClientMarshallerFactory.createMarshallers(declaring, method, providerFactory, config.getServerConsumes()); this.providerFactory = (org.jboss.resteasy.spi.old.ResteasyProviderFactory)config.getProviderFactory(); this.executor = config.getExecutor(); final MediaType[] acpts = MediaTypeHelper.getProduces(declaring, method, config.getServerProduces()); accepts = acpts != null ? acpts[0] : null; this.uri = new ResteasyUriBuilder(); this.baseUri = baseUri; uri.uri(baseUri); if (declaring.isAnnotationPresent(Path.class)) uri.path(declaring); if (method.isAnnotationPresent(Path.class)) uri.path(method); this.extractorFactory = config.getExtractorFactory(); this.extractor = extractorFactory.createExtractor(method); }
public ClientInvoker(URI baseUri, Class declaring, Method method, ProxyConfig config) { this.declaring = declaring; this.method = method; this.marshallers = ClientMarshallerFactory.createMarshallers(declaring, method, providerFactory, config.getServerConsumes()); this.providerFactory = config.getProviderFactory(); this.executor = config.getExecutor(); accepts = MediaTypeHelper.getProduces(declaring, method, config.getServerProduces()); this.uri = new ResteasyUriBuilder(); this.baseUri = baseUri; uri.uri(baseUri); if (declaring.isAnnotationPresent(Path.class)) uri.path(declaring); if (method.isAnnotationPresent(Path.class)) uri.path(method); this.extractorFactory = config.getExtractorFactory(); this.extractor = extractorFactory.createExtractor(method); }