486487488489490491492493
} return revalidateCacheEntry(target, request, context, entry); } catch (IOException ioex) { return handleRevalidationFailure(request, context, entry, now); } catch (ProtocolException e) { throw new ClientProtocolException(e); } }
873874875876877878879880881882883
} @Test public void testNonCompliantRequestWrapsAndReThrowsProtocolException() throws Exception { ClientProtocolException expected = new ClientProtocolException("ouch"); requestIsFatallyNonCompliant(null); requestCannotBeMadeCompliantThrows(expected); boolean gotException = false;
102103104105106107108109
if (config != null) { localcontext.setRequestConfig(config); } return this.requestExecutor.execute(route, wrapper, localcontext, execAware); } catch (final HttpException httpException) { throw new ClientProtocolException(httpException); } }
550551552553554555556557558559560
} @Test public void testNonCompliantRequestWrapsAndReThrowsProtocolException() throws Exception { final ClientProtocolException expected = new ClientProtocolException("ouch"); requestIsFatallyNonCompliant(null); mockRequestProtocolCompliance.makeRequestCompliant((HttpRequestWrapper)anyObject()); expectLastCall().andThrow(expected);
863864865866867868869870
} else { return CloseableHttpResponseProxy.newProxy( director.execute(target, request, execContext)); } } catch(final HttpException httpException) { throw new ClientProtocolException(httpException); } }
181182183184185186187188
} setupContext(localcontext); final HttpRoute route = determineRoute(target, wrapper, localcontext); return this.execChain.execute(route, wrapper, localcontext, execAware); } catch (final HttpException httpException) { throw new ClientProtocolException(httpException); } }
500501502503504505506507
} return revalidateCacheEntry(target, request, context, entry); } catch (final IOException ioex) { return handleRevalidationFailure(request, context, entry, now); } catch (final ProtocolException e) { throw new ClientProtocolException(e); } }
592593594595596597598599600601602
final URI requestURI = request.getURI(); if (requestURI.isAbsolute()) { target = URIUtils.extractHost(requestURI); if (target == null) { throw new ClientProtocolException( "URI does not specify a valid host name: " + requestURI); } } return target; }
110111112113114115116117118119120
399400401402403404405406
}; final BasicFuture<HttpResponse> compositeFuture = new BasicFuture<HttpResponse>(chainedFutureCallback); revalidateCacheEntry(compositeFuture, target, request, context, entry); } catch (final ProtocolException e) { throw new ClientProtocolException(e); } }