Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-11-11 06:39:14 +0000
committerEike Stepper2009-11-11 06:39:14 +0000
commit3c482c3ee91c6499e6e5b43deae3bd75ca113817 (patch)
treef77572bf5327df2c5257cdc0bdb483b916dad2d8
parentddf2fe8740c161bec5d0eb6ad0eb064a33374bc6 (diff)
downloadcdo-3c482c3ee91c6499e6e5b43deae3bd75ca113817.tar.gz
cdo-3c482c3ee91c6499e6e5b43deae3bd75ca113817.tar.xz
cdo-3c482c3ee91c6499e6e5b43deae3bd75ca113817.zip
[294838] TimeoutException on session refresh
https://bugs.eclipse.org/bugs/show_bug.cgi?id=294838
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionPhase2Indication.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java9
-rw-r--r--plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java6
-rw-r--r--plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java7
-rw-r--r--plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLock.java5
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java6
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TimeoutRuntimeException.java11
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java13
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IORuntimeException.java13
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOTimeoutException.java49
-rw-r--r--plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/registry/Registry.java5
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java9
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java7
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java3
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java3
20 files changed, 119 insertions, 52 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
index bd6073e2a1..e2c9ff9374 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/util/CDOQueryQueue.java
@@ -353,7 +353,7 @@ public class CDOQueryQueue<E> implements Queue<E>, Closeable
}
catch (InterruptedException ex)
{
- Thread.currentThread().interrupt();
+ throw WrappedException.wrap(ex);
}
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionPhase2Indication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionPhase2Indication.java
index 915c2e9ddf..05da6fccf2 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionPhase2Indication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/CommitTransactionPhase2Indication.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Simon McDuff - initial API and implementation
* Eike Stepper - maintenance
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.internal.server.XATransactionCommitContext;
import org.eclipse.emf.cdo.internal.server.XATransactionCommitContext.CommitState;
import org.eclipse.emf.cdo.server.internal.net4j.bundle.OM;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -73,7 +74,7 @@ public class CommitTransactionPhase2Indication extends CommitTransactionIndicati
}
catch (InterruptedException ex)
{
- exceptionMessage = ex.getMessage();
+ throw WrappedException.wrap(ex);
}
catch (ExecutionException ex)
{
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
index a9df8b8734..00261b3894 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LockObjectsIndication.java
@@ -19,8 +19,8 @@ import org.eclipse.emf.cdo.common.io.CDODataOutput;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.server.IView;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.concurrent.IRWLockManager.LockType;
-import org.eclipse.net4j.util.io.IORuntimeException;
import java.io.IOException;
import java.util.ArrayList;
@@ -60,7 +60,7 @@ public class LockObjectsIndication extends AbstractSyncRevisionsIndication
}
catch (InterruptedException ex)
{
- throw new IORuntimeException(ex);
+ throw WrappedException.wrap(ex);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 48533a2d8d..4639e9ce25 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -1182,7 +1182,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
catch (InterruptedException ex)
{
- return false;
+ throw WrappedException.wrap(ex);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
index d17293601d..73e4d4b6c4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXATransactionImpl.java
@@ -19,9 +19,11 @@ import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.view.CDOViewSet;
+import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.messages.Messages;
import org.eclipse.net4j.util.CheckUtil;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor;
import org.eclipse.net4j.util.om.monitor.OMMonitor;
import org.eclipse.net4j.util.om.monitor.EclipseMonitor.SynchonizedSubProgressMonitor;
@@ -216,6 +218,7 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
}
catch (TimeoutException ex)
{
+ OM.LOG.warn(ex);
}
}
} while (xaContexts.size() != nbProcessDone);
@@ -292,11 +295,13 @@ public class CDOXATransactionImpl implements InternalCDOXATransaction
{
send(activeContext.values(), new SubProgressMonitor(progressMonitor, 2 - phase));
}
- catch (InterruptedException ignore)
+ catch (InterruptedException ex1)
{
+ throw WrappedException.wrap(ex1);
}
- catch (ExecutionException ignore)
+ catch (ExecutionException ex1)
{
+ OM.LOG.warn(ex1);
}
}
diff --git a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
index 9265099716..de77fd3de1 100644
--- a/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
+++ b/plugins/org.eclipse.net4j.http.common/src/org/eclipse/net4j/http/internal/common/HTTPChannel.java
@@ -4,13 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.http.internal.common;
import org.eclipse.net4j.http.internal.common.HTTPConnector.ChannelOperation;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.spi.net4j.Channel;
@@ -79,8 +80,9 @@ public class HTTPChannel extends Channel
{
openAck.await(timeout, TimeUnit.MILLISECONDS);
}
- catch (InterruptedException ignore)
+ catch (InterruptedException ex)
{
+ throw WrappedException.wrap(ex);
}
}
diff --git a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
index 3601aa6f40..2ede57d62e 100644
--- a/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
+++ b/plugins/org.eclipse.net4j.http.server/src/org/eclipse/net4j/http/internal/server/HTTPServerConnector.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -13,6 +13,7 @@ package org.eclipse.net4j.http.internal.server;
import org.eclipse.net4j.channel.ChannelException;
import org.eclipse.net4j.http.internal.common.HTTPConnector;
import org.eclipse.net4j.protocol.IProtocol;
+import org.eclipse.net4j.util.WrappedException;
import java.text.MessageFormat;
@@ -33,11 +34,13 @@ public class HTTPServerConnector extends HTTPConnector
return acceptor;
}
+ @Override
public Location getLocation()
{
return Location.SERVER;
}
+ @Override
public String getURL()
{
return "agent://connector:" + getConnectorID(); //$NON-NLS-1$
@@ -82,7 +85,7 @@ public class HTTPServerConnector extends HTTPConnector
}
catch (InterruptedException ex)
{
- return false;
+ throw WrappedException.wrap(ex);
}
}
}
diff --git a/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java b/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
index 21754e3cbe..6d7ce71acc 100644
--- a/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
+++ b/plugins/org.eclipse.net4j.http.tests/src/org/eclipse/net4j/http/tests/HTTPTest.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -15,6 +15,7 @@ import org.eclipse.net4j.internal.http.HTTPClientConnector;
import org.eclipse.net4j.tests.AbstractTransportTest;
import org.eclipse.net4j.tests.signal.IntRequest;
import org.eclipse.net4j.tests.signal.TestSignalProtocol;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.container.IManagedContainer;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
@@ -88,7 +89,7 @@ public class HTTPTest extends AbstractTransportTest
}
catch (InterruptedException ex)
{
- throw new RuntimeException(ex);
+ throw WrappedException.wrap(ex);
}
}
});
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLock.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLock.java
index 2e05bc8052..e7d2f4a5af 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLock.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/RWLock.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -104,9 +104,6 @@ public class RWLock extends ReentrantReadWriteLock
throw new TimeoutException("Acquisition of lock timed out after " + timeoutMillis + " millis"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
- catch (InterruptedException ignore)
- {
- }
catch (Exception ex)
{
throw WrappedException.wrap(ex);
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java
index 88a98c6ce1..04418a971f 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/ResultSynchronizer.java
@@ -4,12 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.concurrent;
+import org.eclipse.net4j.util.WrappedException;
+
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
@@ -49,7 +51,7 @@ public final class ResultSynchronizer<RESULT> implements ISynchronizer<RESULT>
}
catch (InterruptedException ex)
{
- return null;
+ throw WrappedException.wrap(ex);
}
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TimeoutRuntimeException.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TimeoutRuntimeException.java
index f759555c8c..4ca33a2064 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TimeoutRuntimeException.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/TimeoutRuntimeException.java
@@ -4,12 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.concurrent;
+import java.util.concurrent.TimeoutException;
+
/**
* @author Eike Stepper
*/
@@ -35,4 +37,11 @@ public class TimeoutRuntimeException extends RuntimeException
{
super(message, cause);
}
+
+ public TimeoutException createTimeoutException()
+ {
+ TimeoutException timeoutException = new TimeoutException(getMessage());
+ timeoutException.initCause(this);
+ return timeoutException;
+ }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
index fbd7388659..45fa9f705c 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/concurrent/Worker.java
@@ -4,13 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.concurrent;
import org.eclipse.net4j.internal.util.bundle.OM;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.lifecycle.Lifecycle;
@@ -87,8 +88,9 @@ public abstract class Worker extends Lifecycle
workerThread.stopRunning();
workerThread.interrupt();
}
- catch (RuntimeException ignore)
+ catch (RuntimeException ex)
{
+ OM.LOG.warn(ex);
}
throw new TimeoutException("Worker thread activation timed out after " + activationTimeout + " millis"); //$NON-NLS-1$ //$NON-NLS-2$
@@ -104,8 +106,9 @@ public abstract class Worker extends Lifecycle
workerThread.interrupt();
workerThread.join(deactivationTimeout);
}
- catch (RuntimeException ignore)
+ catch (RuntimeException ex)
{
+ OM.LOG.warn(ex);
}
super.doDeactivate();
@@ -161,7 +164,7 @@ public abstract class Worker extends Lifecycle
}
catch (InterruptedException ex)
{
- break;
+ throw WrappedException.wrap(ex);
}
}
catch (Terminate terminate)
@@ -170,7 +173,7 @@ public abstract class Worker extends Lifecycle
}
catch (InterruptedException ex)
{
- break;
+ throw WrappedException.wrap(ex);
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IORuntimeException.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IORuntimeException.java
index 716fd3760c..1ac1f9be28 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IORuntimeException.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IORuntimeException.java
@@ -4,13 +4,12 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.io;
-import java.io.IOException;
/**
* @author Eike Stepper
@@ -37,14 +36,4 @@ public class IORuntimeException extends RuntimeException
{
super(message, cause);
}
-
- public void unwrapIOException() throws IOException
- {
- if (getCause() instanceof IOException)
- {
- throw (IOException)getCause();
- }
-
- throw this;
- }
}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOTimeoutException.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOTimeoutException.java
new file mode 100644
index 0000000000..5cb21f5133
--- /dev/null
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/io/IOTimeoutException.java
@@ -0,0 +1,49 @@
+/**
+ * Copyright (c) 2004 - 2009 Eike Stepper (Berlin, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Eike Stepper - initial API and implementation
+ */
+package org.eclipse.net4j.util.io;
+
+import java.io.IOException;
+import java.util.concurrent.TimeoutException;
+
+/**
+ * @author Eike Stepper
+ */
+public class IOTimeoutException extends IOException
+{
+ private static final long serialVersionUID = 1L;
+
+ public IOTimeoutException()
+ {
+ }
+
+ public IOTimeoutException(String message, Throwable cause)
+ {
+ super(message);
+ initCause(cause);
+ }
+
+ public IOTimeoutException(String message)
+ {
+ super(message);
+ }
+
+ public IOTimeoutException(Throwable cause)
+ {
+ initCause(cause);
+ }
+
+ public TimeoutException createTimeoutException()
+ {
+ TimeoutException timeoutException = new TimeoutException(getMessage());
+ timeoutException.initCause(getCause());
+ return timeoutException;
+ }
+}
diff --git a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/registry/Registry.java b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/registry/Registry.java
index 1ede69f41b..14473958f8 100644
--- a/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/registry/Registry.java
+++ b/plugins/org.eclipse.net4j.util/src/org/eclipse/net4j/util/registry/Registry.java
@@ -4,13 +4,14 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.util.registry;
import org.eclipse.net4j.internal.util.bundle.OM;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.container.Container;
import org.eclipse.net4j.util.container.ContainerEvent;
import org.eclipse.net4j.util.container.IContainerDelta;
@@ -223,7 +224,7 @@ public abstract class Registry<K, V> extends Container<Map.Entry<K, V>> implemen
}
catch (InterruptedException ex)
{
- return null;
+ throw WrappedException.wrap(ex);
}
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
index 3b27fede7a..a3e5a67645 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/internal/net4j/buffer/BufferPool.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
@@ -13,6 +13,7 @@ package org.eclipse.internal.net4j.buffer;
import org.eclipse.net4j.buffer.IBuffer;
import org.eclipse.net4j.buffer.IBufferPool;
import org.eclipse.net4j.buffer.IBufferProvider;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.om.trace.ContextTracer;
@@ -114,7 +115,7 @@ public class BufferPool extends BufferProvider implements IBufferPool, IBufferPo
@Override
public String toString()
{
- return MessageFormat.format("BufferPool[{0}]", getBufferCapacity()); //$NON-NLS-1$
+ return MessageFormat.format("BufferPool[{0}]", getBufferCapacity()); //$NON-NLS-1$
}
protected BufferRef createBufferRef(IBuffer buffer)
@@ -229,7 +230,7 @@ public class BufferPool extends BufferProvider implements IBufferPool, IBufferPo
}
catch (InterruptedException ex)
{
- return;
+ throw WrappedException.wrap(ex);
}
finally
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java
index 4666ca0dac..578d0a39e7 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/buffer/BufferInputStream.java
@@ -4,13 +4,15 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* Eike Stepper - initial API and implementation
*/
package org.eclipse.net4j.buffer;
import org.eclipse.net4j.util.HexUtil;
+import org.eclipse.net4j.util.WrappedException;
+import org.eclipse.net4j.util.io.IOTimeoutException;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.internal.net4j.bundle.OM;
@@ -185,7 +187,8 @@ public class BufferInputStream extends InputStream implements IBufferHandler
remaining -= System.currentTimeMillis();
if (remaining <= 0)
{
- return false;
+ // Throw an exception so that caller can distinguish between end-of-stream and a timeout
+ throw new IOTimeoutException();
}
currentBuffer = buffers.poll(Math.min(remaining, check), TimeUnit.MILLISECONDS);
@@ -194,7 +197,7 @@ public class BufferInputStream extends InputStream implements IBufferHandler
}
catch (InterruptedException ex)
{
- throw new IOException("Interrupted"); //$NON-NLS-1$
+ throw WrappedException.wrap(ex);
}
eos = currentBuffer.isEOS();
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
index de5b32783a..5dad069a74 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/Signal.java
@@ -15,17 +15,16 @@ import org.eclipse.net4j.buffer.BufferOutputStream;
import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.io.ExtendedDataInputStream;
import org.eclipse.net4j.util.io.ExtendedDataOutputStream;
+import org.eclipse.net4j.util.io.IOTimeoutException;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.internal.net4j.bundle.OM;
-import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.text.MessageFormat;
-import java.util.concurrent.TimeoutException;
/**
* @author Eike Stepper
@@ -238,9 +237,9 @@ public abstract class Signal implements Runnable
{
execute(bufferInputStream, bufferOutputStream);
}
- catch (EOFException ex)
+ catch (IOTimeoutException ex) // Thrown from BufferInputStream
{
- throw new TimeoutException("Timeout"); //$NON-NLS-1$
+ throw ex.createTimeoutException();
}
catch (Exception ex)
{
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
index 0ef1e68a5b..593924a3b4 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java
@@ -18,6 +18,7 @@ import org.eclipse.net4j.channel.IChannel;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.signal.failover.IFailOverStrategy;
import org.eclipse.net4j.signal.failover.NOOPFailOverStrategy;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.net4j.util.io.IStreamWrapper;
import org.eclipse.net4j.util.io.StreamWrapperChain;
@@ -188,7 +189,7 @@ public class SignalProtocol<INFRA_STRUCTURE> extends Protocol<INFRA_STRUCTURE> i
}
catch (InterruptedException ex)
{
- return false;
+ throw WrappedException.wrap(ex);
}
}
}
diff --git a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
index 1d35e369fc..7ead5ff035 100644
--- a/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
+++ b/plugins/org.eclipse.net4j/src/org/eclipse/spi/net4j/Connector.java
@@ -17,6 +17,7 @@ import org.eclipse.net4j.connector.ConnectorState;
import org.eclipse.net4j.connector.IConnector;
import org.eclipse.net4j.connector.IConnectorStateEvent;
import org.eclipse.net4j.protocol.IProtocol;
+import org.eclipse.net4j.util.WrappedException;
import org.eclipse.net4j.util.ReflectUtil.ExcludeFromDump;
import org.eclipse.net4j.util.event.Event;
import org.eclipse.net4j.util.lifecycle.LifecycleUtil;
@@ -240,7 +241,7 @@ public abstract class Connector extends ChannelMultiplexer implements InternalCo
}
catch (InterruptedException ex)
{
- return false;
+ throw WrappedException.wrap(ex);
}
}

Back to the top