public PoolingHttpDestination(HttpClient client, Origin origin) { super(client, origin); this.connectionPool = newConnectionPool(client); addBean(connectionPool); Sweeper sweeper = client.getBean(Sweeper.class); if (sweeper != null) sweeper.offer(connectionPool); }
@Override protected void doStop() throws Exception { HttpClient client = getHttpClient(); Sweeper sweeper = client.getBean(Sweeper.class); if (sweeper != null) sweeper.remove(connectionPool); super.doStop(); removeBean(connectionPool); }
@Override protected void doStart() throws Exception { HttpClient client = getHttpClient(); this.connectionPool = newConnectionPool(client); addBean(connectionPool); super.doStart(); Sweeper sweeper = client.getBean(Sweeper.class); if (sweeper != null) sweeper.offer(connectionPool); }