public <T> T getClient(final Class<T> asyncIfaceClass, final String connectionStr) {
List<Connection> connections = BlurClientManager.getConnections(connectionStr);
Collections.shuffle(connections, random);
// randomness ftw
final Connection connection = connections.get(0);
return (T) Proxy.newProxyInstance(asyncIfaceClass.getClassLoader(), new Class[] { asyncIfaceClass }, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
return execute(new AsyncCall(asyncIfaceClass, method, args, connection));
}
});