Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project

This commit is contained in:
Jesse McConnell 2012-03-19 08:24:08 -05:00
commit 8e0dd32286
6 changed files with 36 additions and 11 deletions

View File

@ -276,6 +276,11 @@ class SelectConnector extends AggregateLifeCycle implements HttpClient.Connector
_endp.shutdownOutput();
}
public void dispatch()
{
_endp.asyncDispatch();
}
public void asyncDispatch()
{
_endp.asyncDispatch();

View File

@ -19,7 +19,14 @@ public interface AsyncEndPoint extends ConnectedEndPoint
{
/* ------------------------------------------------------------ */
/**
* Dispatch the endpoint to a thread to attend to it.
* Dispatch the endpoint if it is not already dispatched
*
*/
public void dispatch();
/* ------------------------------------------------------------ */
/**
* Dispatch the endpoint. If it is already dispatched, schedule a redispatch
*
*/
public void asyncDispatch();

View File

@ -208,11 +208,7 @@ public class SelectChannelEndPoint extends ChannelEndPoint implements AsyncEndPo
{
synchronized(this)
{
if (_dispatched)
{
throw new IllegalStateException("dispatched");
}
else
if (!_dispatched)
{
_dispatched = true;
boolean dispatched = _manager.dispatch(_handler);

View File

@ -412,7 +412,7 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
// If we are reading into the temp buffer and it has some content, then we should be dispatched.
if (toFill==_unwrapBuf && _unwrapBuf.hasContent() && !_connection.isSuspended())
_aEndp.asyncDispatch();
_aEndp.dispatch();
}
finally
{
@ -721,6 +721,11 @@ public class SslConnection extends AbstractConnection implements AsyncConnection
process(null, null);
}
public void dispatch()
{
_aEndp.dispatch();
}
public void asyncDispatch()
{
_aEndp.asyncDispatch();

View File

@ -32,6 +32,11 @@ public class EmptyAsyncEndPoint implements AsyncEndPoint
private boolean closed;
private int maxIdleTime;
@Override
public void dispatch()
{
}
@Override
public void asyncDispatch()
{

View File

@ -350,10 +350,17 @@ public class AggregateLifeCycle extends AbstractLifeCycle implements Destroyable
/* ------------------------------------------------------------ */
public static void dumpObject(Appendable out,Object o) throws IOException
{
if (o instanceof LifeCycle)
out.append(String.valueOf(o)).append(" - ").append((AbstractLifeCycle.getState((LifeCycle)o))).append("\n");
else
out.append(String.valueOf(o)).append("\n");
try
{
if (o instanceof LifeCycle)
out.append(String.valueOf(o)).append(" - ").append((AbstractLifeCycle.getState((LifeCycle)o))).append("\n");
else
out.append(String.valueOf(o)).append("\n");
}
catch(Throwable th)
{
out.append(" => ").append(th.toString()).append('\n');
}
}
/* ------------------------------------------------------------ */