Produces or returns the existing proxy class. The operation is thread-safe.

@return always the class of the proxy
197414
public Class<T> getProxyClass() {
        String suffix = "_$$_Weld" + getProxyNameSuffix();
        String proxyClassName = getBaseProxyName();
        if (!proxyClassName.endsWith(suffix)) {
            proxyClassName = proxyClassName + suffix;
        }
        if (proxyClassName.startsWith(JAVA)) {
            proxyClassName = proxyClassName.replaceFirst(JAVA, "org.jboss.weld");
        }
        Class<T> proxyClass = null;
        Class<?> originalClass = bean != null ? bean.getBeanClass() : proxiedBeanType;
        BeanLogger.LOG.generatingProxyClass(proxyClassName);
        try {
            // First check to see if we already have this proxy class
            proxyClass = cast(classLoader == null? proxyServices.loadClass(originalClass, proxyClassName) : classLoader.loadClass(proxyClassName));
        } catch (ClassNotFoundException e) {
            // Create the proxy class for this instance
            try {
                proxyClass = createProxyClass(originalClass, proxyClassName);
            } catch (Throwable e1) {
                //attempt to load the class again, just in case another thread
                //defined it between the check and the create method
                try {
                    proxyClass = cast(classLoader == null? proxyServices.loadClass(originalClass, proxyClassName) : classLoader.loadClass(proxyClassName));
                } catch (ClassNotFoundException e2) {
                    BeanLogger.LOG.catchingDebug(e1);
                    throw BeanLogger.LOG.unableToLoadProxyClass(bean, proxiedBeanType, e1);
                }
            }
        }
        return proxyClass;
    }
310764
public static ClassLoader getContextClassLoader() {
        ClassLoader loader = null;
        try {
            loader = Thread.currentThread().getContextClassLoader();
        } catch (Throwable e) {
        }
        if (loader == null) {
            loader = ClassUtils.class.getClassLoader();
        }
        return loader;
    }
515860
protected Class<?> getProxyClass() throws ClassNotFoundException {
        ClassLoader classLoader = getProxyClassLoader();
        return Class.forName(proxyClassName, false, classLoader);
    }
295704
protected final Class<T> getEntityClass() {

		@SuppressWarnings("unchecked")
		final Class<T> result = (Class<T>) TypeHelper.getTypeArguments(JpaSearchRepository.class, this.getClass()).get(0);
		return result;
	}
513399
protected Proxy copy(){
       Socks4Proxy copy = new Socks4Proxy(proxyIP,proxyPort,user);
       copy.directHosts = this.directHosts;
       copy.chainProxy = chainProxy;
       return copy;
    }
621840
private String proxyClassName()
  {
    String simpleName = _proxyClass.getSimpleName();
    int p = simpleName.lastIndexOf("__");
    
    if (p > 0) {
      return simpleName.substring(0, p);
    }
    else {
      return simpleName;
    }
  }
5740
public static Class getProxyFactory(Class persistentClass, Class[] interfaces) throws PersistenceException
    {
        Enhancer e = new Enhancer();
        e.setSuperclass(interfaces.length == 1 ? persistentClass : null);
        e.setInterfaces(interfaces);
        e.setCallbackTypes(new Class[] { InvocationHandler.class, NoOp.class, });
        e.setCallbackFilter(FINALIZE_FILTER);
        e.setUseFactory(false);
        e.setInterceptDuringConstruction(false);
        return e.createClass();
    }
402102
public ProxySelector proxySelector() {
        DefaultProxySelector dps = new DefaultProxySelector();

        for (Proxy proxy : settings.getProxies()) {
            dps.add(MavenConverter.asProxy(proxy), proxy.getNonProxyHosts());
        }

        return dps;
    }
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();
        }
    }
1215252
public static ProxyMetaClass getInstance(Class theClass) throws IntrospectionException {
        MetaClassRegistry metaRegistry = GroovySystem.getMetaClassRegistry();
        MetaClass meta = metaRegistry.getMetaClass(theClass);
        return new ProxyMetaClass(metaRegistry, theClass, meta);
    }
537016
public T instantiateAnonymousSubclass() {
        Class<T> proxyClass = giveDynamicSubclass(type);
        return objenesis.newInstance(proxyClass);
    }
684724
@Deprecated
    public ProxySelector getOriginalProxySelector() {
        return new ProxySelector() {
            @Override
            public List<Proxy> select(URI uri) {
                InetSocketAddress address = originalProxies.get(uri.getScheme());
                if (address != null && !(originalNonProxyHosts.contains(uri.getHost()))) {
                    return Collections.singletonList(new Proxy(HTTP, address));
                } else {
                    return Collections.singletonList(Proxy.NO_PROXY);
                }
            }

            @Override
            public void connectFailed(URI uri, SocketAddress sa, IOException ioe) {
            }
        };
    }
82827
public static Class<?> getCallingClass() {
        ClassContextSecurityManager securityManager = getSecurityManager();
        if (securityManager == null)
            return null;
        Class<?>[] trace = securityManager.getClassContext();
        String thisClassName = Util.class.getName();

        // Advance until Util is found
        int i;
        for (i = 0; i < trace.length; i++) {
            if (thisClassName.equals(trace[i].getName()))
                break;
        }

        // trace[i] = Util; trace[i+1] = caller; trace[i+2] = caller's caller
        if (i >= trace.length || i + 2 >= trace.length) {
            throw new IllegalStateException("Failed to find org.slf4j.helpers.Util or its caller in the stack; " + "this should not happen");
        }

        return trace[i + 2];
    }
1306442
final public function generateClass()
    {
        static $docBlock;
        if (empty($docBlock)) {
            $writer = new Writer();
            $writer
                ->writeln('/**')
                ->writeln(' * CG library enhanced proxy class.')
                ->writeln(' *')
                ->writeln(' * This code was generated automatically by the CG library, manual changes to it')
                ->writeln(' * will be lost upon next generation.')
                ->write(' */')
            ;
            $docBlock = $writer->getContent();
        }

        $this->generatedClass = PhpClass::create()
            ->setDocblock($docBlock)
            ->setParentClassName($this->class->name)
        ;

        $proxyClassName = $this->getClassName($this->class);
        if (false === strpos($proxyClassName, NamingStrategyInterface::SEPARATOR)) {
            throw new \RuntimeException(sprintf('The proxy class name must be suffixed with "%s" and an optional string, but got "%s".', NamingStrategyInterface::SEPARATOR, $proxyClassName));
        }
        $this->generatedClass->setName($proxyClassName);

        if (!empty($this->interfaces)) {
            $this->generatedClass->setInterfaceNames(array_map(function($v) { return '\\'.$v; }, $this->interfaces));

            foreach ($this->getInterfaceMethods() as $method) {
                $method = PhpMethod::fromReflection($method);
                $method->setAbstract(false);

                $this->generatedClass->setMethod($method);
            }
        }

        if (!empty($this->generators)) {
            foreach ($this->generators as $generator) {
                $generator->generate($this->class, $this->generatedClass);
            }
        }

        return $this->generateCode($this->generatedClass);
    }
911103
public T get() {
        Object object = null;
        try {
            ProxyTarget target = locator.locateProxyTarget();
            if (target != null) {
                try {
                    object = target.getTarget();
                } finally {
                    if (target instanceof ReleasableProxyTarget) {
                        // Sadly we don't know much what is done with the target by the caller, so we just release it
                        // right now
                        ((ReleasableProxyTarget) target).releaseTarget();
                    }
                }
            }
        } catch (RuntimeException e) {
            LOG.trace("locating target failed, will return null then", e);
        }
        return type.cast(object);
    }
569168
@SuppressWarnings("unchecked")
  @Override
  public Class<T> versionClass() {
    if (this.retentionPolicies.size() == 1) {
      return (Class<T>) this.retentionPolicies.get(0).versionClass();
    }

    Class<T> klazz = (Class<T>) this.retentionPolicies.get(0).versionClass();
    for (RetentionPolicy<T> policy : this.retentionPolicies) {
      klazz = commonSuperclass(klazz, (Class<T>) policy.versionClass());
    }
    return klazz;
  }
966729
@Override
    public Class<?> getProxyClass() {
        if (proxyClass != null) {
            return proxyClass;
        }
        try {
            if (StringUtils.isNotBlank(interfaceId)) {
                this.proxyClass = ClassUtils.forName(interfaceId);
                if (!proxyClass.isInterface()) {
                    throw ExceptionUtils.buildRuntime("service.interfaceId",
                        interfaceId, "interfaceId must set interface class, not implement class");
                }
            } else {
                throw ExceptionUtils.buildRuntime("service.interfaceId",
                    "null", "interfaceId must be not null");
            }
        } catch (SofaRpcRuntimeException e) {
            throw e;
        } catch (Throwable e) {
            throw new SofaRpcRuntimeException(e.getMessage(), e);
        }
        return proxyClass;
    }