summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorThomas Becker2011-09-28 11:25:46 (EDT)
committer Jesse McConnell2011-09-28 11:56:46 (EDT)
commit1e5b85a2cb459873b5e7b1ded145b05fd3889ace (patch)
treebea04afa9e7b5bebca4ab26058d1b4f7e2af91e0
parentcceef37f17f3c61fe515d0866e396914468f51f7 (diff)
downloadorg.eclipse.jetty.project-1e5b85a2cb459873b5e7b1ded145b05fd3889ace.zip
org.eclipse.jetty.project-1e5b85a2cb459873b5e7b1ded145b05fd3889ace.tar.gz
org.eclipse.jetty.project-1e5b85a2cb459873b5e7b1ded145b05fd3889ace.tar.bz2
359255: Allow HttpExchange state change from START to EXPIRED
-rw-r--r--jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java
index 9f431e5..e3e07a1 100644
--- a/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java
+++ b/jetty-client/src/main/java/org/eclipse/jetty/client/HttpExchange.java
@@ -208,6 +208,9 @@ public class HttpExchange
case STATUS_EXCEPTED:
set = _status.compareAndSet(oldStatus,newStatus);
break;
+ case STATUS_EXPIRED:
+ set = setStatusExpired(newStatus,oldStatus);
+ break;
}
break;
case STATUS_WAITING_FOR_CONNECTION:
@@ -219,8 +222,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -233,8 +235,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -250,8 +251,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -264,8 +264,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -281,8 +280,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -298,8 +296,7 @@ public class HttpExchange
set = _status.compareAndSet(oldStatus,newStatus);
break;
case STATUS_EXPIRED:
- if (set = _status.compareAndSet(oldStatus,newStatus))
- getEventListener().onExpire();
+ set = setStatusExpired(newStatus,oldStatus);
break;
}
break;
@@ -359,6 +356,14 @@ public class HttpExchange
}
}
+ private boolean setStatusExpired(int newStatus, int oldStatus)
+ {
+ boolean set;
+ if (set = _status.compareAndSet(oldStatus,newStatus))
+ getEventListener().onExpire();
+ return set;
+ }
+
public boolean isDone()
{
synchronized (this)