diff options
-rw-r--r-- | plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithMonitoring.java | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithMonitoring.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithMonitoring.java index 4d25822c1e..f178df2873 100644 --- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithMonitoring.java +++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/IndicationWithMonitoring.java @@ -12,6 +12,7 @@ package org.eclipse.net4j.signal; import org.eclipse.net4j.buffer.BufferInputStream; import org.eclipse.net4j.buffer.BufferOutputStream; +import org.eclipse.net4j.channel.IChannel; import org.eclipse.net4j.util.io.ExtendedDataInputStream; import org.eclipse.net4j.util.io.ExtendedDataOutputStream; import org.eclipse.net4j.util.lifecycle.LifecycleUtil; @@ -128,9 +129,10 @@ public abstract class IndicationWithMonitoring extends IndicationWithResponse { sendProgress(); } - catch (Exception ex) + catch (Throwable ex) { OM.LOG.error("ReportingMonitorTask failed", ex); + cancel(); } } }; @@ -158,13 +160,20 @@ public abstract class IndicationWithMonitoring extends IndicationWithResponse private void sendProgress() { + SignalProtocol<?> protocol = getProtocol(); + try { - new MonitorProgressRequest(getProtocol(), -getCorrelationID(), getTotalWork(), getWork()).sendAsync(); + int correlationID = -getCorrelationID(); + double totalWork = getTotalWork(); + double work = getWork(); + + new MonitorProgressRequest(protocol, correlationID, totalWork, work).sendAsync(); } catch (Exception ex) { - if (LifecycleUtil.isActive(getProtocol().getChannel())) + IChannel channel = protocol.getChannel(); + if (LifecycleUtil.isActive(channel)) { OM.LOG.error(ex); } |