diff options
author | Tobias Schwarz | 2014-05-20 09:32:10 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-05-20 09:32:10 +0000 |
commit | 2dd7dbb20e6637538547184917076115d34a7f3a (patch) | |
tree | df48f4a9242106b5d4ffd4e4413ee83e2ddc72b1 | |
parent | 238187605aa38745a13a3f8fd276b9cbc957453a (diff) | |
download | org.eclipse.tcf-2dd7dbb20e6637538547184917076115d34a7f3a.tar.gz org.eclipse.tcf-2dd7dbb20e6637538547184917076115d34a7f3a.tar.xz org.eclipse.tcf-2dd7dbb20e6637538547184917076115d34a7f3a.zip |
Target Explorer: catch possible exception on shutdown
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java index 8acfc38b5..3d515fa81 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/StartPingTimerStep.java @@ -79,28 +79,34 @@ public class StartPingTimerStep extends AbstractPeerNodeStep { final AtomicBoolean running = new AtomicBoolean(false); @Override public void run() { - if (!running.get()) { - running.set(true); - Protocol.invokeLater(new Runnable() { - @Override - public void run() { - if (peerNode.getConnectState() == IConnectable.STATE_CONNECTED) { - diagnostics.echo("ping", new IDiagnostics.DoneEcho() { //$NON-NLS-1$ - @Override - public void doneEcho(IToken token, Throwable error, String s) { - running.set(false); - if (error != null) { - thisTimer.cancel(); - } + try { + if (!running.get()) { + running.set(true); + Protocol.invokeLater(new Runnable() { + @Override + public void run() { + try { + if (peerNode.getConnectState() == IConnectable.STATE_CONNECTED) { + diagnostics.echo("ping", new IDiagnostics.DoneEcho() { //$NON-NLS-1$ + @Override + public void doneEcho(IToken token, Throwable error, String s) { + running.set(false); + if (error != null) { + thisTimer.cancel(); + } + } + }); } - }); - } - else { - thisTimer.cancel(); + else { + thisTimer.cancel(); + } + } + catch (Throwable e) {} } - } - }); + }); + } } + catch (Throwable e) {} } }; pingTimer.schedule(pingTask, 10000, 10000); |