I have a Runnable running inside a ThreadPoolExecutor long polling on an http request using the HttpClient .
So I am doing the request in a very way :
httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
clientParams.setSoTimeout(timeout);
HttpMethodBase method = new GetMethod(request.toString());
int iGetResultCode = 0;
iGetResultCode = httpClient.executeMethod(method);
Now I really would like to cancel the polling from an other thread ( or somehow ).
shutdown is not really working , so maybe you know what else could I try.
I’m with Stephen C on this one. httpclient.executeMethod looks like it should react to an InterruptedException (whether IO or other). If you are not seeing any exception propogation you can try closing the InputStream from the HttpClient.
This should close the input stream reading from the website and also throw IOExceptions which the thread-pool thread will see. If the connection does close but you still do not see any IOException I would assume you are swallowing an exception somewhere