/** * Create a new instance of the {@link WebSphereLoadTimeWeaver} class using * the default {@link ClassLoader class loader}. * @see org.springframework.util.ClassUtils#getDefaultClassLoader() */ public WebSphereLoadTimeWeaver() { this(ClassUtils.getDefaultClassLoader()); }
/** * Create a new DefaultResourceLoader. * <p>ClassLoader access will happen using the thread context class loader * at the time of this ResourceLoader's initialization. * @see java.lang.Thread#getContextClassLoader() */ public DefaultResourceLoader() { this.classLoader = ClassUtils.getDefaultClassLoader(); }
/** * Create a new instance of the {@link GlassFishLoadTimeWeaver} class using * the default {@link ClassLoader class loader}. * @see org.springframework.util.ClassUtils#getDefaultClassLoader() */ public GlassFishLoadTimeWeaver() { this(ClassUtils.getDefaultClassLoader()); }
/** * Create a StandardTypeLocator for the default ClassLoader * (typically, the thread context ClassLoader). */ public StandardTypeLocator() { this(ClassUtils.getDefaultClassLoader()); }
/** * Creates a new instance of the {@link WebLogicLoadTimeWeaver} class using * the default {@link ClassLoader class loader}. * @see org.springframework.util.ClassUtils#getDefaultClassLoader() */ public WebLogicLoadTimeWeaver() { this(ClassUtils.getDefaultClassLoader()); }
/** * Create a new InstrumentationLoadTimeWeaver for the default ClassLoader. */ public InstrumentationLoadTimeWeaver() { this(ClassUtils.getDefaultClassLoader()); }
/** * Create a new ReflectiveLoadTimeWeaver for the current context class * loader, <i>which needs to support the required weaving methods</i>. */ public ReflectiveLoadTimeWeaver() { this(ClassUtils.getDefaultClassLoader()); }
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException { // Rely on default serialization; just initialize state after deserialization. ois.defaultReadObject(); // Initialize transient fields. this.proxyClassLoader = ClassUtils.getDefaultClassLoader(); }
/** * Return the ClassLoader to load class path resources with. * <p>Will get passed to ClassPathResource's constructor for all * ClassPathResource objects created by this resource loader. * @see ClassPathResource */ @Override @Nullable public ClassLoader getClassLoader() { return (this.classLoader != null ? this.classLoader : ClassUtils.getDefaultClassLoader()); }
/** * Create a default ClassEditor, using the given ClassLoader. * @param classLoader the ClassLoader to use * (or {@code null} for the thread context ClassLoader) */ public ClassEditor(@Nullable ClassLoader classLoader) { this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); }
@Override @Nullable public ClassLoader getClassLoader() { return ClassUtils.getDefaultClassLoader(); }
/** * This implementation returns the default ClassLoader. * @see org.springframework.util.ClassUtils#getDefaultClassLoader() */ @Override @Nullable public ClassLoader getClassLoader() { return ClassUtils.getDefaultClassLoader(); }
/** * Resolve the given class name into a Class. * <p>The default implementations uses {@code ClassUtils.forName}, * using the thread context class loader. * @param className the class name to resolve * @return the resolved Class * @throws ClassNotFoundException if the class name was invalid */ protected Class<?> resolveClassName(String className) throws ClassNotFoundException { return ClassUtils.forName(className, ClassUtils.getDefaultClassLoader()); }
@Override @Nullable public ClassLoader getClassLoader() { return ClassUtils.getDefaultClassLoader(); }
/** * Create a default {@code ClassArrayEditor}, using the given * {@code ClassLoader}. * @param classLoader the {@code ClassLoader} to use * (or pass {@code null} for the thread context {@code ClassLoader}) */ public ClassArrayEditor(@Nullable ClassLoader classLoader) { this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); }
/** * Create a new {@code DefaultNamespaceHandlerResolver} using the * supplied mapping file location. * @param classLoader the {@link ClassLoader} instance used to load mapping resources * may be {@code null}, in which case the thread context ClassLoader will be used) * @param handlerMappingsLocation the mapping file location */ public DefaultNamespaceHandlerResolver(@Nullable ClassLoader classLoader, String handlerMappingsLocation) { Assert.notNull(handlerMappingsLocation, "Handler mappings location must not be null"); this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader()); this.handlerMappingsLocation = handlerMappingsLocation; }
/** * Return the GroovyClassLoader used by this script factory. */ public GroovyClassLoader getGroovyClassLoader() { synchronized (this.scriptClassMonitor) { if (this.groovyClassLoader == null) { this.groovyClassLoader = buildGroovyClassLoader(ClassUtils.getDefaultClassLoader()); } return this.groovyClassLoader; } }
/** * Convert an array of {@code MBeanParameterInfo} into an array of * {@code Class} instances corresponding to the parameters. * @param paramInfo the JMX parameter info * @return the parameter types as classes * @throws ClassNotFoundException if a parameter type could not be resolved */ @Nullable public static Class<?>[] parameterInfoToTypes(@Nullable MBeanParameterInfo[] paramInfo) throws ClassNotFoundException { return parameterInfoToTypes(paramInfo, ClassUtils.getDefaultClassLoader()); }
@Override @Nullable public ClassLoader getClassLoader() { return ClassUtils.getDefaultClassLoader(); }
@Test public void testDefaultLoadTimeWeaver() { ClassLoader loader = new SimpleInstrumentableClassLoader(ClassUtils.getDefaultClassLoader()); ReflectiveLoadTimeWeaver handler = new ReflectiveLoadTimeWeaver(loader); assertSame(loader, handler.getInstrumentableClassLoader()); }