simplifications and fixes from porting auction to oort
git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@325 7e9141cc-0065-0410-87d8-b60c137991c4
This commit is contained in:
parent
f3926b4bf7
commit
8f940927ff
|
@ -104,7 +104,9 @@ class SelectConnector extends AbstractLifeCycle implements HttpClient.Connector,
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
Log.warn(e.toString());
|
||||
Log.debug(e);
|
||||
Thread.yield();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ContinuationFilter implements Filter
|
|||
{
|
||||
if (_faux)
|
||||
{
|
||||
final FauxContinuation fc = new FauxContinuation(this, request,response);
|
||||
final FauxContinuation fc = new FauxContinuation(request,response);
|
||||
request.setAttribute(Continuation.ATTRIBUTE,fc);
|
||||
boolean complete=false;
|
||||
|
||||
|
|
|
@ -20,6 +20,9 @@ import javax.servlet.ServletResponse;
|
|||
|
||||
/* ------------------------------------------------------------ */
|
||||
/** ContinuationSupport.
|
||||
*
|
||||
* Factory class for accessing Continuation instances, which with either be
|
||||
* native to the container (jetty >= 6), a servlet 3.0 or a faux continuation.
|
||||
*
|
||||
*/
|
||||
public class ContinuationSupport
|
||||
|
@ -66,11 +69,32 @@ public class ContinuationSupport
|
|||
}
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param request
|
||||
* @deprecated use {@link #getContinuation(ServletRequest, ServletResponse)}
|
||||
* @return a Continuation instance
|
||||
*/
|
||||
public static Continuation getContinuation(final ServletRequest request)
|
||||
{
|
||||
return getContinuation(request,null);
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------ */
|
||||
/**
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
public static Continuation getContinuation(final ServletRequest request, final ServletResponse response)
|
||||
{
|
||||
Continuation continuation = (Continuation) request.getAttribute(Continuation.ATTRIBUTE);
|
||||
if (continuation!=null)
|
||||
{
|
||||
// TODO save wrappers?
|
||||
|
||||
return continuation;
|
||||
}
|
||||
|
||||
if (__servlet3 )
|
||||
{
|
||||
|
|
|
@ -21,7 +21,6 @@ import javax.servlet.ServletResponse;
|
|||
|
||||
class FauxContinuation implements Continuation
|
||||
{
|
||||
private final ContinuationFilter _continuationFilter;
|
||||
private static final int __HANDLING=1; // Request dispatched to filter/servlet
|
||||
private static final int __SUSPENDING=2; // Suspend called, but not yet returned to container
|
||||
private static final int __RESUMING=3; // resumed while suspending
|
||||
|
@ -42,9 +41,8 @@ class FauxContinuation implements Continuation
|
|||
|
||||
private ArrayList<ContinuationListener> _listeners;
|
||||
|
||||
FauxContinuation(ContinuationFilter continuationFilter, final ServletRequest request,final ServletResponse response)
|
||||
FauxContinuation(final ServletRequest request,final ServletResponse response)
|
||||
{
|
||||
_continuationFilter = continuationFilter;
|
||||
_request=request;
|
||||
_response=response;
|
||||
}
|
||||
|
@ -397,7 +395,7 @@ class FauxContinuation implements Continuation
|
|||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
_continuationFilter._context.log("OpenServletFilter caught ",e);
|
||||
break;
|
||||
}
|
||||
wait=expire_at-System.currentTimeMillis();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue