/** * Check whether the given class implements an interface with a given class name. * @param clazz the class to check * @param ifaceClassName the interface class name to check */ private static boolean implementsInterface(Class<?> clazz, String ifaceClassName) { try { Class<?> ifaceClass = ClassLoaderUtil.loadClass(ifaceClassName, ProxyUtil.class); return ifaceClass.isAssignableFrom(clazz); } catch (ClassNotFoundException e) { return false; } }
/** * Utility method to obtain the class matched to className. Caches look ups so that subsequent * lookups will be faster. * * @param className The fully qualified name of the class to return * @return The class itself * @throws ClassNotFoundException */ public Class getClassInstance(String className) throws ClassNotFoundException { if (ccl != null) { return ccl.loadClass(className); } return ClassLoaderUtil.loadClass(className, this.getClass()); }
private Class getClassInstance() { try { return ClassLoaderUtil.loadClass(clazz, ActionContext.getContext().getClass()); } catch (Exception e) { LOG.error("Class '" + clazz + "' not found...",e); } return null; } }
/** * Check whether the given member is a member of a spring proxy. * @param member the member to check */ private static boolean isSpringProxyMember(Member member) { try { Class<?> clazz = ClassLoaderUtil.loadClass(SPRING_ADVISED_CLASS_NAME, ProxyUtil.class); if (hasMember(clazz, member)) return true; clazz = ClassLoaderUtil.loadClass(SPRING_TARGETCLASSAWARE_CLASS_NAME, ProxyUtil.class); if (hasMember(clazz, member)) return true; clazz = ClassLoaderUtil.loadClass(SPRING_SPRINGPROXY_CLASS_NAME, ProxyUtil.class); if (hasMember(clazz, member)) return true; } catch (ClassNotFoundException ignored) { } return false; }
/** * {@inheritDoc} */ public String determineResultPath(ActionConfig actionConfig) { if (actionConfig == null) { return resultPath; } try { return determineResultPath(ClassLoaderUtil.loadClass(actionConfig.getClassName(), this.getClass())); } catch (ClassNotFoundException e) { throw new RuntimeException("Invalid action class configuration that references an unknown " + "class named [" + actionConfig.getClassName() + "]", e); } }
implClass = ClassLoaderUtil.loadClass(implClassName, this .getClass()); } catch (ClassNotFoundException e1) {