Package org.apache.http.client.methods

Examples of org.apache.http.client.methods.HttpGet.abort()


          return PageFetchStatus.OK;
        } else {
          return PageFetchStatus.PageLoadError;
        }
      } else {
        get.abort();
      }
    } catch (IOException e) {
      logger.error("Fatal transport error: " + e.getMessage() + " while fetching " + toFetchURL
          + " (link found in doc #" + page.getWebURL().getParentDocid() + ")");
      return PageFetchStatus.FatalTransportError;
View Full Code Here


    } finally {
      try {
        if (entity != null) {
          entity.consumeContent();
        } else if (get != null) {
          get.abort();
        }
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
View Full Code Here

                    HttpGet httpget = new HttpGet(this.requestURI);
                    HttpResponse response = this.httpclient.execute(
                            this.target,
                            httpget);
                    if (this.forceClose) {
                        httpget.abort();
                    } else {
                        HttpEntity entity = response.getEntity();
                        if (entity != null) {
                            entity.consumeContent();
                        }
View Full Code Here

        } catch (ConnectionPoolTimeoutException expected) {
        }
       
        HttpEntity e = response.getEntity();
        assertNotNull(e);
        httpget.abort();
       
        // Expect zero connections in the pool
        assertEquals(0, mgr.getConnectionsInPool());

        // Make sure one connection is available
View Full Code Here

            }
        }).start();
       
        assertTrue("should have tried to get a connection", connLatch.await(1, TimeUnit.SECONDS));
       
        httpget.abort();
       
        assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS));
        assertTrue("should be instanceof IOException, was: " + throwableRef.get(),
                throwableRef.get() instanceof IOException);
        assertTrue("cause should be InterruptedException, was: " + throwableRef.get().getCause(),
View Full Code Here

            }
        }).start();
       
        Thread.sleep(100); // Give it a little time to proceed to release...
       
        httpget.abort();
       
        releaseLatch.countDown();
       
        assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS));
        assertTrue("should be instanceof IOException, was: " + throwableRef.get(),
View Full Code Here

                    getLatch.countDown();
                }
            }
        }).start();
       
        httpget.abort();
        startLatch.countDown();
       
        assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS));
        assertTrue("should be instanceof IOException, was: " + throwableRef.get(),
                throwableRef.get() instanceof IOException);
View Full Code Here

            }
        }).start();
       
        assertTrue("should have tried to get a connection", connLatch.await(1, TimeUnit.SECONDS));
       
        httpget.abort();
       
        assertTrue("should have finished get request", getLatch.await(1, TimeUnit.SECONDS));
        assertTrue("should be instanceof IOException, was: " + throwableRef.get(),
                throwableRef.get() instanceof IOException);
        assertTrue("cause should be InterruptedException, was: " + throwableRef.get().getCause(),
View Full Code Here

        {
            throw new TransferFailedException( "Could not read response body.", e );
        }
        finally
        {
            getMethod.abort();
        }
    }
}
View Full Code Here

      fetchResult.setStatusCode(Status.INTERNAL_SERVER_ERROR.ordinal());
      return fetchResult;
    } finally {
      try {
        if (entity == null && get != null)
          get.abort();
      } catch (Exception e) {
        throw e;
      }
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.