Improved toString() for ConnectionPool implementations.
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
This commit is contained in:
parent
cef80aca2e
commit
e89e8ae16e
|
@ -67,8 +67,19 @@ public abstract class AbstractConnectionPool implements ConnectionPool, Dumpable
|
|||
return connections.getLo();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the number of pending connections
|
||||
* @deprecated use {@link #getPendingConnectionCount()} instead
|
||||
*/
|
||||
@ManagedAttribute(value = "The number of pending connections", readonly = true)
|
||||
@Deprecated
|
||||
public int getPendingCount()
|
||||
{
|
||||
return getPendingConnectionCount();
|
||||
}
|
||||
|
||||
@ManagedAttribute(value = "The number of pending connections", readonly = true)
|
||||
public int getPendingConnectionCount()
|
||||
{
|
||||
return connections.getHi();
|
||||
}
|
||||
|
|
|
@ -309,9 +309,10 @@ public class DuplexConnectionPool extends AbstractConnectionPool implements Swee
|
|||
unlock();
|
||||
}
|
||||
|
||||
return String.format("%s@%x[c=%d/%d,a=%d,i=%d]",
|
||||
return String.format("%s@%x[c=%d/%d/%d,a=%d,i=%d]",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
getPendingConnectionCount(),
|
||||
getConnectionCount(),
|
||||
getMaxConnectionCount(),
|
||||
activeSize,
|
||||
|
|
|
@ -382,9 +382,10 @@ public class MultiplexConnectionPool extends AbstractConnectionPool implements C
|
|||
{
|
||||
unlock();
|
||||
}
|
||||
return String.format("%s@%x[c=%d/%d,b=%d,m=%d,i=%d]",
|
||||
return String.format("%s@%x[c=%d/%d/%d,b=%d,m=%d,i=%d]",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
getPendingConnectionCount(),
|
||||
getConnectionCount(),
|
||||
getMaxConnectionCount(),
|
||||
busySize,
|
||||
|
|
|
@ -214,9 +214,10 @@ public class RoundRobinConnectionPool extends AbstractConnectionPool implements
|
|||
}
|
||||
}
|
||||
}
|
||||
return String.format("%s@%x[c=%d/%d,a=%d]",
|
||||
return String.format("%s@%x[c=%d/%d/%d,a=%d]",
|
||||
getClass().getSimpleName(),
|
||||
hashCode(),
|
||||
getPendingConnectionCount(),
|
||||
present,
|
||||
getMaxConnectionCount(),
|
||||
active
|
||||
|
|
Loading…
Reference in New Issue