Improved toString() methods for better reporting during dump().
This commit is contained in:
parent
32ae2a15b2
commit
43f14997d8
|
@ -527,6 +527,15 @@ public abstract class HttpReceiver
|
|||
return updated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x(rcv=%s)",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
responseState);
|
||||
}
|
||||
|
||||
/**
|
||||
* The request states {@link HttpReceiver} goes through when receiving a response.
|
||||
*/
|
||||
|
|
|
@ -547,6 +547,16 @@ public abstract class HttpSender implements AsyncContentProvider.Listener
|
|||
return new IllegalStateException("Expected " + current + " found " + senderState.get() + " instead");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x(req=%s,snd=%s)",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
requestState,
|
||||
senderState);
|
||||
}
|
||||
|
||||
/**
|
||||
* The request states {@link HttpSender} goes through when sending a request.
|
||||
*/
|
||||
|
|
|
@ -105,6 +105,10 @@ public class HttpChannelOverHTTP extends HttpChannel
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x", getClass().getSimpleName(), hashCode());
|
||||
return String.format("%s@%x(send=%s,recv=%s)",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
sender,
|
||||
receiver);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,11 +152,12 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%h(l:%s <-> r:%s)",
|
||||
return String.format("%s@%h(l:%s <-> r:%s)[%s]",
|
||||
getClass().getSimpleName(),
|
||||
this,
|
||||
getEndPoint().getLocalAddress(),
|
||||
getEndPoint().getRemoteAddress());
|
||||
getEndPoint().getRemoteAddress(),
|
||||
channel);
|
||||
}
|
||||
|
||||
private class Delegate extends HttpConnection
|
||||
|
|
|
@ -302,6 +302,6 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x on %s", getClass().getSimpleName(), hashCode(), getHttpConnection());
|
||||
return String.format("%s[%s]", super.toString(), parser);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -208,6 +208,12 @@ public class HttpSenderOverHTTP extends HttpSender
|
|||
getHttpChannel().getHttpConnection().getEndPoint().shutdownOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s[%s]", super.toString(), generator);
|
||||
}
|
||||
|
||||
private class ByteBufferRecyclerCallback implements Callback
|
||||
{
|
||||
private final Callback callback;
|
||||
|
|
Loading…
Reference in New Issue