Creation of actual instance from {@link IPrototype}
@param proxy prototype instance to be realized
@return realized instance
190106
protected T handleRealize(T proxy)
	{
		T ret = createInstance(proxy);
		PropertyResolverConverter prc = getPropertyResolverConverter();
		for (Map.Entry<String, Object> entry: values.entrySet()) {
			String propertyName = entry.getKey();
			Object value = entry.getValue();
			int mappedIndicatorIndx = propertyName.indexOf(':');
			if(mappedIndicatorIndx<0)
			{
				try
				{
					PropertyResolver.setValue(propertyName, ret, value, prc);
				} catch (WicketRuntimeException e)
				{
					LOG.error("Can't set property"+propertyName, e);
				}
			}
			else
			{
				String propertyExp = propertyName.substring(0, mappedIndicatorIndx);
				String fieldExp = propertyName.substring(mappedIndicatorIndx+1);
				Object object = ret;
				int subObject = propertyExp.lastIndexOf('.');
				if(subObject>=0)
				{
					object = PropertyResolver.getValue(propertyExp.substring(0, subObject), object);
					propertyExp = propertyExp.substring(subObject+1);
				}
				if(object!=null)
				{
					String methodName="set"+propertyExp.substring(0, 1).toUpperCase()+propertyExp.substring(1);
					Method[] methods = object.getClass().getMethods();
					try
					{
						for (Method method : methods)
						{
							if(method.getName().equals(methodName))
							{
								Class<?>[] paramTypes = method.getParameterTypes();
								if(paramTypes.length==2 
										&& paramTypes[0].isAssignableFrom(String.class)
										&& (value==null || paramTypes[1].isInstance(value)))
								{
									method.invoke(object, fieldExp, value);
									break;
								}
							}
						}
					} catch (Exception e)
					{
						LOG.error("Can't set property "+propertyName, e);
					} 
					
				}
			}
		}
		realized = ret;
		if(listener!=null) listener.onRealizePrototype((IPrototype<T>)proxy);
		return ret;
	}
536494
public final ProxyHandler newProxyHandler() {
		InetSocketAddress proxyAddr = this.address.get();
		String username = this.username;
		String password = Objects.nonNull(username) && Objects.nonNull(this.password) ?
				this.password.apply(username) : null;

		switch (this.type) {
			case HTTP:
				return Objects.nonNull(username) && Objects.nonNull(password) ?
						new HttpProxyHandler(proxyAddr, username, password, this.httpHeaders.get()) :
						new HttpProxyHandler(proxyAddr, this.httpHeaders.get());
			case SOCKS4:
				return Objects.nonNull(username) ? new Socks4ProxyHandler(proxyAddr, username) :
						new Socks4ProxyHandler(proxyAddr);
			case SOCKS5:
				return Objects.nonNull(username) && Objects.nonNull(password) ?
						new Socks5ProxyHandler(proxyAddr, username, password) :
						new Socks5ProxyHandler(proxyAddr);
		}
		throw new IllegalArgumentException("Proxy type unsupported : " + this.type);
	}
74228
public Proxy createSeleniumProxy() {
    return isEmpty(config.proxyHost())
      ? ClientUtil.createSeleniumProxy(proxy)
      : ClientUtil.createSeleniumProxy(proxy, inetAddressResolver.getInetAddressByName(config.proxyHost()));
  }
755900
public static <T> T create(Class<T> proxyInterface) {
    return create(proxyInterface, Thread.currentThread().getContextClassLoader());
  }
636294
public InvocationHandler getInvocationHandler(Object proxy) {
        Field field = getInvocationHandlerField();
        try {
            return (InvocationHandler) field.get(proxy);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException("Object is not a proxy of correct type", e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }
1292571
public final Object getRealObject(Object objectOrProxy)
    {
        if(isNormalOjbProxy(objectOrProxy))
        {
            String msg;

            try
            {
                return getIndirectionHandler(objectOrProxy).getRealSubject();
            }
            catch(ClassCastException e)
            {
                // shouldn't happen but still ...
                msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(IllegalArgumentException e)
            {
                msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for given Proxy: " + objectOrProxy);
                throw e;
            }
        }
        else if(isVirtualOjbProxy(objectOrProxy))
        {
            try
            {
                return ((VirtualProxy) objectOrProxy).getRealSubject();
            }
            catch(PersistenceBrokerException e)
            {
                log.error("Could not retrieve real object for VirtualProxy: " + objectOrProxy);
                throw e;
            }
        }
        else
        {
            return objectOrProxy;
        }
    }
96162
public Class getRealClass(Object objectOrProxy)
    {
        IndirectionHandler handler;

        if(isNormalOjbProxy(objectOrProxy))
        {
            String msg;

            try
            {
                handler = getIndirectionHandler(objectOrProxy);
                /*
                 arminw:
                 think we should return the real class
                 */
                // return handler.getIdentity().getObjectsTopLevelClass();
                return handler.getIdentity().getObjectsRealClass();
            }
            catch(ClassCastException e)
            {
                // shouldn't happen but still ...
                msg = "The InvocationHandler for the provided Proxy was not an instance of " + IndirectionHandler.class.getName();
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
            catch(IllegalArgumentException e)
            {
                msg = "Could not retrieve real object for given Proxy: " + objectOrProxy;
                log.error(msg);
                throw new PersistenceBrokerException(msg, e);
            }
        }
        else if(isVirtualOjbProxy(objectOrProxy))
        {
            handler = VirtualProxy.getIndirectionHandler((VirtualProxy) objectOrProxy);
            /*
             arminw:
             think we should return the real class
             */
            // return handler.getIdentity().getObjectsTopLevelClass();
            return handler.getIdentity().getObjectsRealClass();
        }
        else
        {
            return objectOrProxy.getClass();
        }
    }
836039
public static <T extends VersionedProtocol> ProtocolProxy<T> getProtocolProxy(
      Class<T> protocol,
      long clientVersion, InetSocketAddress addr, Configuration conf)
      throws IOException {

    return getProtocolProxy(protocol, clientVersion, addr, conf, NetUtils
        .getDefaultSocketFactory(conf));
  }
1295323
protected static <P extends AbstractEncoderProxy<T>, T> Object newInstance(
        final Class<P> proxyType, final Class<T> encoderType, final T encoder) {

        if (proxyType == null) {
            throw new NullPointerException("proxyType");
        }

        if (!StringEncoderProxy.class.isAssignableFrom(proxyType)) {
            throw new IllegalArgumentException(
                "proxyType(" + proxyType + ") is not assignable to "
                + StringEncoderProxy.class);
        }

        return newInstance(ENCODER.getClassLoader(), new Class<?>[]{ENCODER},
                           proxyType, encoderType, encoder);
    }
160086
private JdbcTemplateProxy getProxy(){
		if(_proxy == null){
			_proxy = new JdbcTemplateProxy();
			_proxy.setJdbcTemplate(jdbcTemplate);
		}
		return _proxy;
	}
384127
public static <T> T proxy(T target, Aspect aspect){
		return ProxyFactory.createProxy(target, aspect);
	}
963810
public JsTopicControls getJsTopicControlsFromProxyClass(Class<?> proxy) {
		Class<?> realClass = unProxyClassServices.getRealClass(proxy);
		return realClass.getAnnotation(JsTopicControls.class);
	}
715204
public void setProxy(Proxy proxy)
    {
        if(proxy != null)
        {
            java.net.Proxy p = new java.net.Proxy(java.net.Proxy.Type.HTTP,
                    new InetSocketAddress(proxy.getHost(), proxy.getPort()));
            client.setProxy(p);
        }
        else
            client.setProxy(java.net.Proxy.NO_PROXY);
    }
802560
public void setProxy(String proxyhost, int proxyport) {
		proxy = new java.net.Proxy(java.net.Proxy.Type.HTTP, new InetSocketAddress(proxyhost, proxyport));
	}
118682
public static boolean isIndependentProxy(
            GSIConstants.CertificateType certType) {
        return certType == GSIConstants.CertificateType.GSI_3_INDEPENDENT_PROXY
                || certType == GSIConstants.CertificateType.GSI_4_INDEPENDENT_PROXY;
    }
452037
public static NoProxyPortSelector getInstance()
    {
        if( _instance == null )
        {
            synchronized( NoProxyPortSelector.class )
            {
                if( _instance == null )
                {
                    _instance = new NoProxyPortSelector();
                }
            }
        }

        return _instance;
    }
840049
public Proxy setHttpProxy(String httpProxy) {
    verifyProxyTypeCompatibility(ProxyType.MANUAL);
    this.proxyType = ProxyType.MANUAL;
    this.httpProxy = httpProxy;
    return this;
  }