Get the associated proxy class.

@return the proxy class
@throws ClassNotFoundException if the proxy class is not found
515860
protected Class<?> getProxyClass() throws ClassNotFoundException {
        ClassLoader classLoader = getProxyClassLoader();
        return Class.forName(proxyClassName, false, classLoader);
    }
1194017
<T> Class<T> loadClass(String name) throws ClassNotFoundException {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        if (null == cl) {
            cl = ToHelper.class.getClassLoader();
        }
        return (Class<T>) cl.loadClass(name);
    }
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();
        }
    }
1142344
public static Class<? extends WebPage> loadClass(String className) throws ClassNotFoundException {
		return Class.forName(className).asSubclass(WebPage.class);
	}
806534
public NonDelayedClassInfo getClassInfo() {

        String useName = getName();

        NonDelayedClassInfo useClassInfo = this.classInfo;

        if (useClassInfo != null) {
            if (!useClassInfo.isJavaClass() &&
                !(useClassInfo.isAnnotationPresent() ||
                  useClassInfo.isFieldAnnotationPresent() ||
                useClassInfo.isMethodAnnotationPresent())) {
                getInfoStore().recordAccess(useClassInfo);
            }
            return useClassInfo;
        }

        useClassInfo = getInfoStore().resolveClassInfo(useName);

        String[] useLogParms = getLogParms();
        if (useLogParms != null) {
            useLogParms[EXTRA_DATA_OFFSET_0] = useName;
        }

        if (useClassInfo == null) {
            // defect 84235: If an error caused this, the warning was reported at a lower level. Since this is 
            // going to be 'handled', we should not generate another warning message.
            //Tr.warning(tc, "ANNO_CLASSINFO_CLASS_NOTFOUND", getHashText(), useName); // CWWKC0025W

            if (useLogParms != null) {
                Tr.debug(tc, MessageFormat.format("[ {0} ] - Class not found [ {1} ]",
                                                  (Object[]) useLogParms));
            }

            useClassInfo = new NonDelayedClassInfo(useName, getInfoStore());

            this.isArtificial = true;

            // START: TFB: Defect 59284: More required updates:
            //
            // The newly created class info was not properly added as a class info,
            // leading to an NPE in the cache list management (in ClassInfoCache.makeFirst).

            getInfoStore().getClassInfoCache().addClassInfo(useClassInfo);

            // END: TFB: Defect 59284: More required updates:
        }

        // START: TFB: Defect 59284: Don't throw an exception for a failed load.
        //
        // Tracing enablement for defect 59284 showed an error of the sequence
        // of assigning the result class info hash text into the logging parameters.
        //
        // Prior to the assignment steps, 'this.classInfo' is null.
        //
        // A NullPointerException results, respective only of trace enablement
        // and irrespective of the d59284 changes.
        //
        // Move the logging code to after the 'this.classInfo' assignment.

        // if (useLogParms != null) {
        //     useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText();
        // }

        useClassInfo.setDelayedClassInfo(this);
        this.classInfo = useClassInfo;

        if (useLogParms != null) {
            useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // D59284

            if (this.isArtificial) {
                Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ** ARTFICIAL **",
                                                  (Object[]) useLogParms));
            } else {
                Tr.debug(tc, MessageFormat.format("[ {0} ] RETURN [ {1} ] as [ {2} ] ",
                                                  (Object[]) useLogParms));
            }
        }

        // END: TFB: Defect 59284: Don't throw an exception for a failed load.

        return useClassInfo;
    }
621840
private String proxyClassName()
  {
    String simpleName = _proxyClass.getSimpleName();
    int p = simpleName.lastIndexOf("__");
    
    if (p > 0) {
      return simpleName.substring(0, p);
    }
    else {
      return simpleName;
    }
  }
1158527
protected static Class findClass(final String className) throws ClassNotFoundException {
        try {
            return Thread.currentThread().getContextClassLoader().loadClass(className);
        } catch (ClassNotFoundException e) {
            try {
                return Class.forName(className);
            } catch (ClassNotFoundException e1) {
                return MavenCoordHelper.class.getClassLoader().loadClass(className);
            }
        }
    }
850082
public Class<?> getClassType() {

        if (m_type == null) {
            return String.class;
        }
        try {
            return Class.forName(m_type);
        } catch (ClassNotFoundException e) {
            return String.class;
        }
    }
450648
public ClassNotFoundException toClassNotFoundException() {
        ClassDescriptor classDescriptor = DescriptorFactory.createClassDescriptorFromResourceName(resourceName);
        return new ClassNotFoundException("ResourceNotFoundException while looking for class "
                + classDescriptor.toDottedClassName() + ": " + getMessage());
    }
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;
    }
637471
public JavaClass lookupClass(@Nonnull @DottedClassName String className) throws ClassNotFoundException {
        try {
            if (className.length() == 0) {
                throw new IllegalArgumentException("Class name is empty");
            }
            if (!ClassName.isValidClassName(className)) {
                throw new ClassNotFoundException("Invalid class name: " + className);
            }
            return Global.getAnalysisCache().getClassAnalysis(JavaClass.class,
                    DescriptorFactory.instance().getClassDescriptor(ClassName.toSlashedClassName(className)));
        } catch (CheckedAnalysisException e) {
            throw new ClassNotFoundException("Class not found: " + className, e);
        }
    }
858492
public JavaClass lookupClass(String className) throws ClassNotFoundException {
        if (classesThatCantBeFound.contains(className)) {
            throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
        }
        String resourceName = className.replace('.', '/') + ".class";
        InputStream in = null;
        boolean parsedClass = false;

        try {

            in = getInputStreamForResource(resourceName);
            if (in == null) {
                classesThatCantBeFound.add(className);
                throw new ClassNotFoundException("Error while looking for class " + className + ": class not found");
            }

            ClassParser classParser = new ClassParser(in, resourceName);
            JavaClass javaClass = classParser.parse();
            parsedClass = true;

            return javaClass;
        } catch (IOException e) {
            classesThatCantBeFound.add(className);
            throw new ClassNotFoundException("IOException while looking for class " + className, e);
        } finally {
            if (in != null && !parsedClass) {
                try {
                    in.close();
                } catch (IOException ignore) {
                    // Ignore
                }
            }
        }
    }
814748
protected Object available() throws ClassNotFoundException {
        Object result = null;
        if (getVar() != null) {
            Object value = pageContext.getAttribute(getVar(), getVarScope());
            if (value instanceof SlingBean) {
                Class<?> type = getComponentType();
                if (type != null && type.isAssignableFrom(value.getClass())) {
                    result = value;
                }
            }
        }
        return result;
    }
144344
public static Class getClass(String name) throws ClassNotFoundException
    {
        try
        {
            return Class.forName(name);
        }
        catch (ClassNotFoundException ex)
        {
            throw new ClassNotFoundException(name);
        }
    }
524500
@Nonnull
  public ClassLoader getClassLoader ()
  {
    return m_aBestCandidate == null ? Thread.currentThread ().getContextClassLoader ()
                                    : m_aBestCandidate.getClassLoader ();
  }
402102
public ProxySelector proxySelector() {
        DefaultProxySelector dps = new DefaultProxySelector();

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

        return dps;
    }
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;
    }