Improved logging and toString() implementations.
This commit is contained in:
parent
8d9fd6ad71
commit
1df50f86f9
|
@ -73,4 +73,10 @@ public abstract class HttpChannel
|
|||
{
|
||||
disassociate();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%h", getClass().getSimpleName(), this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,4 +148,10 @@ public abstract class HttpConnection implements Connection
|
|||
authnResult.apply(request);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%h", getClass().getSimpleName(), this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
|
|||
{
|
||||
HttpClient client = getHttpClient();
|
||||
final HttpExchange exchange = getHttpExchanges().poll();
|
||||
LOG.debug("Processing exchange {} on connection {}", exchange, connection);
|
||||
LOG.debug("Processing {} on {}", exchange, connection);
|
||||
if (exchange == null)
|
||||
return false;
|
||||
|
||||
|
@ -130,7 +130,6 @@ public abstract class MultiplexHttpDestination<C extends Connection> extends Htt
|
|||
public void close(Connection connection)
|
||||
{
|
||||
super.close(connection);
|
||||
assert this.connection == connection;
|
||||
while (true)
|
||||
{
|
||||
ConnectState current = connect.get();
|
||||
|
|
|
@ -136,9 +136,9 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec
|
|||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format("%s@%x(l:%s <-> r:%s)",
|
||||
HttpConnection.class.getSimpleName(),
|
||||
hashCode(),
|
||||
return String.format("%s@%h(l:%s <-> r:%s)",
|
||||
getClass().getSimpleName(),
|
||||
this,
|
||||
getEndPoint().getLocalAddress(),
|
||||
getEndPoint().getRemoteAddress());
|
||||
}
|
||||
|
@ -171,5 +171,11 @@ public class HttpConnectionOverHTTP extends AbstractConnection implements Connec
|
|||
{
|
||||
HttpConnectionOverHTTP.this.close();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return HttpConnectionOverHTTP.this.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue