public static HttpClientConnectionManager wrap
    (HttpClientConnectionManager orig) {
        if (orig instanceof Wrapped)
            throw new IllegalArgumentException();
        final Class<?>[] interfaces;
        if (orig instanceof ConnPoolControl) {
            interfaces = new Class<?>[]{
                    HttpClientConnectionManager.class,
                    ConnPoolControl.class,
                    Wrapped.class
            };
        } else {
            interfaces = new Class<?>[]{
                    HttpClientConnectionManager.class,
                    Wrapped.class
            };
        }
        return (HttpClientConnectionManager) Proxy.newProxyInstance(
                // https://github.com/aws/aws-sdk-java/pull/48#issuecomment-29454423
                ClientConnectionManagerFactory.class.getClassLoader(),
                interfaces,
                new Handler(orig));
    }
public static HttpClientConnectionManager wrap ( HttpClientConnectionManager orig ) { if ( orig instanceof Wrapped ) throw new IllegalArgumentException ( ) ; final Class < ? > [ ] interfaces ; if ( orig instanceof ConnPoolControl ) { interfaces = new Class < ? > [ ] { HttpClientConnectionManager . class , ConnPoolControl . class , Wrapped . class } ; } else { interfaces = new Class < ? > [ ] { HttpClientConnectionManager . class , Wrapped . class } ; } return ( HttpClientConnectionManager ) Proxy . newProxyInstance ( ClientConnectionManagerFactory . class . getClassLoader ( ) , interfaces , new Handler ( orig ) ) ; }
Returns a wrapped instance of {@link HttpClientConnectionManager}
to capture the necessary performance metrics.

@param orig the target instance to be wrapped