@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestContext request context}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestContext request context}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestContext request context}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
@Override public Continuation<ClientRequest> apply(ClientRequest requestContext) { for (ClientRequestFilter filter : requestFilters) { try { filter.filter(requestContext); final Response abortResponse = requestContext.getAbortResponse(); if (abortResponse != null) { throw new AbortException(new ClientResponse(requestContext, abortResponse)); } } catch (IOException ex) { throw new ProcessingException(ex); } } return Continuation.of(requestContext, getDefaultNext()); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestScope.Instance request scope instance}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
processedRequest = addUserAgent(processedRequest, connector.getName()); } catch (final AbortException aborted) { processResponse(aborted.getAbortResponse(), callback); return;
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestContext request context}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestScope.Instance request scope instance}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }
/** * Invoke a request processing synchronously in the context of the caller's thread. * <p> * NOTE: the method does not explicitly start a new request scope context. Instead * it is assumed that the method is invoked from within a context of a proper, running * {@link RequestScope.Instance request scope instance}. A caller may use the * {@link #getRequestScope()} method to retrieve the request scope instance and use it to * initialize the proper request scope context prior the method invocation. * </p> * * @param request client request to be invoked. * @return client response. * * @throws javax.ws.rs.ProcessingException in case of an invocation failure. */ public ClientResponse invoke(final ClientRequest request) { ClientResponse response; try { try { response = connector.apply(addUserAgent(Stages.process(request, requestProcessingRoot), connector.getName())); } catch (final AbortException aborted) { response = aborted.getAbortResponse(); } return Stages.process(response, responseProcessingRoot); } catch (final ProcessingException pe) { throw pe; } catch (final Throwable t) { throw new ProcessingException(t.getMessage(), t); } }