summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2006-10-23 15:00:49 (EDT)
committerEike Stepper2006-10-23 15:00:49 (EDT)
commit08904699fd314ea52d7b12fbad7866b9192f2483 (patch)
tree9862abac8b2e9470cc726e2b17d6a7c561b79f42
parent9c8e247ed1b1b4565d29391f9c38535baff39f74 (diff)
downloadcdo-08904699fd314ea52d7b12fbad7866b9192f2483.zip
cdo-08904699fd314ea52d7b12fbad7866b9192f2483.tar.gz
cdo-08904699fd314ea52d7b12fbad7866b9192f2483.tar.bz2
Signal protocol
-rw-r--r--plugins/org.eclipse.net4j/src/org/eclipse/net4j/signal/SignalProtocol.java10
1 files changed, 7 insertions, 3 deletions
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 e093a0f..01a4dab 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
@@ -30,11 +30,15 @@ import java.util.concurrent.ExecutorService;
*/
public abstract class SignalProtocol extends AbstractProtocol
{
+ private static final int MIN_CORRELATION_ID = 1;
+
+ private static final int MAX_CORRELATION_ID = Integer.MAX_VALUE;
+
private ExecutorService executorService;
private Map<Integer, Signal> signals = new ConcurrentHashMap();
- private int nextCorrelationID = 1;
+ private int nextCorrelationID = MIN_CORRELATION_ID;
protected SignalProtocol(Channel channel, ExecutorService executorService)
{
@@ -125,10 +129,10 @@ public abstract class SignalProtocol extends AbstractProtocol
int getNextCorrelationID()
{
int correlationID = nextCorrelationID;
- if (nextCorrelationID == Integer.MAX_VALUE)
+ if (nextCorrelationID == MAX_CORRELATION_ID)
{
System.out.println(toString() + ": Correlation wrap around");
- nextCorrelationID = 0;
+ nextCorrelationID = MIN_CORRELATION_ID;
}
else
{