} catch(Exception e) { if (httpGet.isAborted()) { throw new IOException(String.format("Total Stellar REST request time to %s exceeded the configured timeout of %d ms.", httpGet.getURI().toString(), restConfig.getTimeout())); } else {
@Override protected void doStop(ServiceStopper stopper) throws Exception { if (httpMethod != null) { // In some versions of the JVM a race between the httpMethod and the completion // of the method when using HTTPS can lead to a deadlock. This hack attempts to // detect that and interrupt the thread that's locked so that they can complete // on another attempt. for (int i = 0; i < 3; ++i) { Thread abortThread = new Thread(new Runnable() { @Override public void run() { try { httpMethod.abort(); } catch (Exception e) { } } }); abortThread.start(); abortThread.join(2000); if (abortThread.isAlive() && !httpMethod.isAborted()) { abortThread.interrupt(); } } } }
@Override protected void doStop(ServiceStopper stopper) throws Exception { if (httpMethod != null) { // In some versions of the JVM a race between the httpMethod and the completion // of the method when using HTTPS can lead to a deadlock. This hack attempts to // detect that and interrupt the thread that's locked so that they can complete // on another attempt. for (int i = 0; i < 3; ++i) { Thread abortThread = new Thread(new Runnable() { @Override public void run() { try { httpMethod.abort(); } catch (Exception e) { } } }); abortThread.start(); abortThread.join(2000); if (abortThread.isAlive() && !httpMethod.isAborted()) { abortThread.interrupt(); } } } }
@Override protected void doStop(ServiceStopper stopper) throws Exception { if (httpMethod != null) { // In some versions of the JVM a race between the httpMethod and the completion // of the method when using HTTPS can lead to a deadlock. This hack attempts to // detect that and interrupt the thread that's locked so that they can complete // on another attempt. for (int i = 0; i < 3; ++i) { Thread abortThread = new Thread(new Runnable() { @Override public void run() { try { httpMethod.abort(); } catch (Exception e) { } } }); abortThread.start(); abortThread.join(2000); if (abortThread.isAlive() && !httpMethod.isAborted()) { abortThread.interrupt(); } } } }
if (!getMethod.isAborted()) { Trace.trace(Activator.PLUGIN_ID, "calling getMethod.abort()"); //$NON-NLS-1$ getMethod.abort();
if (!getMethod.isAborted()) { Trace.trace(Activator.PLUGIN_ID, "calling getMethod.abort()"); //$NON-NLS-1$ getMethod.abort();