https://issues.apache.org/activemq/browse/AMQ-2600 - jetty7 - continuations api adaptations - web demo works now

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@908458 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2010-02-10 11:50:13 +00:00
parent 5a7ceacce9
commit 25f476624f
2 changed files with 5 additions and 5 deletions

View File

@ -27,7 +27,7 @@
<form action="message/FOO/BAR" method="post"> <form action="message/FOO/BAR" method="post">
<p> <p>
<label for="destination">Destination name</label> <label for="destination">Destination name</label>
<input type="text" name="destination"/> <input type="text" name="destination" value="FOO.BAR"/>
</p> </p>
<p> <p>
<label for="type">Destination Type: </label> <label for="type">Destination Type: </label>

View File

@ -264,9 +264,8 @@ public class MessageListenerServlet extends MessageServletSupport {
} }
Continuation continuation = ContinuationSupport.getContinuation(request); Continuation continuation = ContinuationSupport.getContinuation(request);
continuation.setTimeout(timeout);
Listener listener = getListener(request); Listener listener = getListener(request);
if (listener != null && continuation != null && !continuation.isSuspended()) { if (listener != null && continuation != null && !continuation.isInitial()) {
listener.access(); listener.access();
} }
@ -293,15 +292,16 @@ public class MessageListenerServlet extends MessageServletSupport {
// Get an existing Continuation or create a new one if there are no // Get an existing Continuation or create a new one if there are no
// messages // messages
if (message == null) { if (message == null && continuation.isInitial()) {
// register this continuation with our listener. // register this continuation with our listener.
listener.setContinuation(continuation); listener.setContinuation(continuation);
// Get the continuation object (may wait and/or retry // Get the continuation object (may wait and/or retry
// request here). // request here).
continuation.setTimeout(timeout);
continuation.suspend(); continuation.suspend();
return;
} }
listener.setContinuation(null);
// prepare the responds // prepare the responds
response.setContentType("text/xml"); response.setContentType("text/xml");