Uses of Class
java.lang.ClassLoader
Packages that useClassLoader
Package
Description
Provides interfaces and classes for transferring data between and withinapplications.
Contains classes related to developingbeans -- components based onthe JavaBeans architecture.
Provides classes that are fundamental to the design of the Javaprogramming language.
Provides classfile parsing, generation, and transformation library.
Provides services that allow Java programming language agents to instrumentprograms running on the Java Virtual Machine (JVM).
The
java.lang.invoke package provides low-level primitives for interactingwith the Java Virtual Machine.Provides classes and interfaces for obtaining reflective information aboutclasses and objects.
Provides the classes for implementing networking applications.
Defines interfaces and classes for the Java virtual machine to access files,file attributes, and file systems.
Provides classes and interfaces for supporting the server side of RMI.
Provides the classes and interfaces for the security framework.
Contains the collections framework, some internationalization support classes,a service loader, properties, random number generation, string parsingand scanning classes, base64 encoding and decoding, a bit array, andseveral miscellaneous utility classes.
A package of the Java Image I/O API containing the plug-in interfaces forreaders, writers, transcoders, and streams, and a runtime registry.
Provides the core classes for the Java Management Extensions.
Provides the classes which implement advanced dynamicloading.
The RMI connector is a connector for the JMX Remote API that uses RMI to transmit client requests to a remote MBean server.
The scripting API consists of interfaces and classes that defineJava Scripting Engines and providesa framework for their use in Java applications.
Standard interfaces and base classes for JDBC
RowSet implementations.Provides a set of "lightweight" (all-Java language) componentsthat, to the maximum degree possible, work the same on all platforms.
Provides interfaces for tools which can be invoked from a program,for example, compilers.
Defines XML/Java Type Mappings.
Provides the classes for processing XML documents with a SAX (Simple API for XML)parser or a DOM (Document Object Model) Document builder.
Defines interfaces and classes for the Streaming API for XML (StAX).
Defines the generic APIs for processing transformation instructions,and performing a transformation from source to result.
Provides an API for validation of XML documents.
Provides anobject-model neutral API for theevaluation of XPath expressions and access to the evaluationenvironment.
Contains interfaces and classes that are used to link an
invokedynamic call site.Provides implementation support for building JShell execution engines.
Uses ofClassLoader injava.awt.datatransfer
Methods injava.awt.datatransfer with parameters of typeClassLoaderModifier and TypeMethodDescriptionprotected static finalClass<?> DataFlavor.tryToLoadClass(String className,ClassLoader fallback) Tries to load a class from: the bootstrap loader, the system loader, thecontext loader (if one is present) and finally the loader specified.Constructors injava.awt.datatransfer with parameters of typeClassLoaderModifierConstructorDescriptionDataFlavor(String mimeType,String humanPresentableName,ClassLoader classLoader) Constructs aDataFlavorthat represents aMimeType.Uses ofClassLoader injava.beans
Methods injava.beans with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticDefaultHandlerXMLDecoder.createHandler(Object owner,ExceptionListener el,ClassLoader cl) Creates a new handler for SAX parserthat can be used to parse embedded XML archivescreated by theXMLEncoderclass.staticObjectBeans.instantiate(ClassLoader cls,String beanName) Instantiate a JavaBean.staticObjectBeans.instantiate(ClassLoader cls,String beanName,BeanContext beanContext) Deprecated, for removal: This API element is subject to removal in a future version.this method will be removed when java.beans.beancontext is removedstaticObjectBeans.instantiate(ClassLoader cls,String beanName,BeanContext beanContext,AppletInitializer initializer) Deprecated, for removal: This API element is subject to removal in a future version.It is recommended to useBeans.instantiate(ClassLoader, String, BeanContext),because the Applet API is deprecated.Constructors injava.beans with parameters of typeClassLoaderModifierConstructorDescriptionXMLDecoder(InputStream in,Object owner,ExceptionListener exceptionListener,ClassLoader cl) Creates a new input stream for reading archivescreated by theXMLEncoderclass.Uses ofClassLoader injava.lang
Methods injava.lang that returnClassLoaderModifier and TypeMethodDescriptionModuleLayer.findLoader(String name) Returns theClassLoaderfor the module with the given name.Class.getClassLoader()Returns the class loader for the class.Module.getClassLoader()Returns theClassLoaderfor this module.Thread.getContextClassLoader()Returns the contextClassLoaderfor this thread.finalClassLoaderClassLoader.getParent()Returns the parent class loader for delegation.staticClassLoaderClassLoader.getPlatformClassLoader()Returns the platform class loader.staticClassLoaderClassLoader.getSystemClassLoader()Returns the system class loader.Methods injava.lang with parameters of typeClassLoaderModifier and TypeMethodDescriptionModuleLayer.defineModulesWithManyLoaders(Configuration cf,ClassLoader parentLoader) Creates a new module layer, with this layer as its parent, by defining themodules in the givenConfigurationto the Java virtual machine.staticModuleLayer.ControllerModuleLayer.defineModulesWithManyLoaders(Configuration cf,List<ModuleLayer> parentLayers,ClassLoader parentLoader) Creates a new module layer by defining the modules in the givenConfigurationto the Java virtual machine.ModuleLayer.defineModulesWithOneLoader(Configuration cf,ClassLoader parentLoader) Creates a new module layer, with this layer as its parent, by defining themodules in the givenConfigurationto the Java virtual machine.staticModuleLayer.ControllerModuleLayer.defineModulesWithOneLoader(Configuration cf,List<ModuleLayer> parentLayers,ClassLoader parentLoader) Creates a new module layer by defining the modules in the givenConfigurationto the Java virtual machine.staticClass<?> Class.forName(String name, boolean initialize,ClassLoader loader) Returns theClassobject associated with the class orinterface with the given string name, using the given class loader.voidThread.setContextClassLoader(ClassLoader cl) Sets the contextClassLoaderfor this thread.Method parameters injava.lang with type arguments of typeClassLoaderModifier and TypeMethodDescriptionModuleLayer.defineModules(Configuration cf,Function<String,ClassLoader> clf) Creates a new module layer, with this layer as its parent, by defining themodules in the givenConfigurationto the Java virtual machine.staticModuleLayer.ControllerModuleLayer.defineModules(Configuration cf,List<ModuleLayer> parentLayers,Function<String,ClassLoader> clf) Creates a new module layer by defining the modules in the givenConfigurationto the Java virtual machine.Constructors injava.lang with parameters of typeClassLoaderModifierConstructorDescriptionprotectedClassLoader(ClassLoader parent) Creates a new class loader using the specified parent class loader fordelegation.protectedClassLoader(String name,ClassLoader parent) Creates a new class loader of the specified name and using thespecified parent class loader for delegation.Uses ofClassLoader injava.lang.classfile
Methods injava.lang.classfile with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticClassHierarchyResolverClassHierarchyResolver.ofClassLoading(ClassLoader loader) Returns aClassHierarchyResolverthat extracts class hierarchyinformation via classes loaded by a class loader with reflection.staticClassHierarchyResolverClassHierarchyResolver.ofResourceParsing(ClassLoader loader) Returns aClassHierarchyResolverthat extracts class hierarchyinformation fromclassfiles located by a class loader.Uses ofClassLoader injava.lang.instrument
Methods injava.lang.instrument with parameters of typeClassLoaderModifier and TypeMethodDescriptionClass[]Instrumentation.getInitiatedClasses(ClassLoader loader) Returns an array of all classes whichloadercan find by nameviaClassLoader::loadClass,Class::forNameand bytecode linkage.default byte[]ClassFileTransformer.transform(ClassLoader loader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain, byte[] classfileBuffer) Transforms the given class file and returns a new replacement class file.default byte[]ClassFileTransformer.transform(Module module,ClassLoader loader,String className,Class<?> classBeingRedefined,ProtectionDomain protectionDomain, byte[] classfileBuffer) Transforms the given class file and returns a new replacement class file.Uses ofClassLoader injava.lang.invoke
Methods injava.lang.invoke with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticMethodTypeMethodType.fromMethodDescriptorString(String descriptor,ClassLoader loader) Finds or creates an instance of a method type of the given method descriptor(JVMS4.3.3).Uses ofClassLoader injava.lang.reflect
Methods injava.lang.reflect with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticClass<?> Proxy.getProxyClass(ClassLoader loader,Class<?>... interfaces) Deprecated.Proxy classes generated in a named module are encapsulated and not accessible to code outside its module.staticObjectProxy.newProxyInstance(ClassLoader loader,Class<?>[] interfaces,InvocationHandler h) Returns a proxy instance for the specified interfacesthat dispatches method invocations to the specified invocationhandler.Uses ofClassLoader injava.net
Subclasses ofClassLoader injava.netModifier and TypeClassDescriptionclassThis class loader is used to load classes and resources from a searchpath of URLs referring to both JAR files and directories.Methods injava.net with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticURLClassLoaderURLClassLoader.newInstance(URL[] urls,ClassLoader parent) Creates a new instance of URLClassLoader for the specifiedURLs and parent class loader.Constructors injava.net with parameters of typeClassLoaderModifierConstructorDescriptionURLClassLoader(String name,URL[] urls,ClassLoader parent) Constructs a new namedURLClassLoaderfor the specified URLs.URLClassLoader(String name,URL[] urls,ClassLoader parent,URLStreamHandlerFactory factory) Constructs a new namedURLClassLoaderfor the specified URLs,parent class loader, and URLStreamHandlerFactory.URLClassLoader(URL[] urls,ClassLoader parent) Constructs a new URLClassLoader for the given URLs.URLClassLoader(URL[] urls,ClassLoader parent,URLStreamHandlerFactory factory) Constructs a new URLClassLoader for the specified URLs, parentclass loader, and URLStreamHandlerFactory.Uses ofClassLoader injava.nio.file
Methods injava.nio.file with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticFileSystemFileSystems.newFileSystem(URI uri,Map<String, ?> env,ClassLoader loader) Constructs a new file system that is identified by aURIstaticFileSystemFileSystems.newFileSystem(Path path,ClassLoader loader) Constructs a newFileSystemto access the contents of a file as afile system.staticFileSystemFileSystems.newFileSystem(Path path,Map<String, ?> env,ClassLoader loader) Constructs a newFileSystemto access the contents of a file as afile system.Uses ofClassLoader injava.rmi.server
Methods injava.rmi.server that returnClassLoaderModifier and TypeMethodDescriptionstaticClassLoaderRMIClassLoader.getClassLoader(String codebase) Returns a class loader that loads classes from the given codebaseURL path.abstractClassLoaderRMIClassLoaderSpi.getClassLoader(String codebase) Provides the implementation forRMIClassLoader.getClassLoader(String).Methods injava.rmi.server with parameters of typeClassLoaderModifier and TypeMethodDescriptionLoaderHandler.getSecurityContext(ClassLoader loader) Deprecated.no replacementstaticObjectRMIClassLoader.getSecurityContext(ClassLoader loader) Deprecated.no replacement.staticClass<?> RMIClassLoader.loadClass(String codebase,String name,ClassLoader defaultLoader) Loads a class from a codebase URL path, optionally using thesupplied loader.abstractClass<?> RMIClassLoaderSpi.loadClass(String codebase,String name,ClassLoader defaultLoader) Provides the implementation forRMIClassLoader.loadClass(URL,String),RMIClassLoader.loadClass(String,String), andRMIClassLoader.loadClass(String,String,ClassLoader).staticClass<?> RMIClassLoader.loadProxyClass(String codebase,String[] interfaces,ClassLoader defaultLoader) Loads a dynamic proxy class (seeProxy)that implements a set of interfaces with the given namesfrom a codebase URL path.abstractClass<?> RMIClassLoaderSpi.loadProxyClass(String codebase,String[] interfaces,ClassLoader defaultLoader) Provides the implementation forRMIClassLoader.loadProxyClass(String,String[],ClassLoader).Uses ofClassLoader injava.security
Subclasses ofClassLoader injava.securityModifier and TypeClassDescriptionclassThis class extendsClassLoaderwith additional support for definingclasses with an associated code source and permissions.Methods injava.security that returnClassLoaderModifier and TypeMethodDescriptionfinalClassLoaderProtectionDomain.getClassLoader()Returns theClassLoaderof this domain.Constructors injava.security with parameters of typeClassLoaderModifierConstructorDescriptionProtectionDomain(CodeSource codesource,PermissionCollection permissions,ClassLoader classloader,Principal[] principals) Creates a newProtectionDomainqualified by the givenCodeSource, permissions,ClassLoaderand arrayof principals.protectedSecureClassLoader(ClassLoader parent) Creates a newSecureClassLoaderusing the specified parentclass loader for delegation.protectedSecureClassLoader(String name,ClassLoader parent) Creates a newSecureClassLoaderof the specified name andusing the specified parent class loader for delegation.Uses ofClassLoader injava.util
Methods injava.util with parameters of typeClassLoaderModifier and TypeMethodDescriptionstatic final voidResourceBundle.clearCache(ClassLoader loader) Removes all resource bundles from the cache that have been loadedby the given class loader.staticResourceBundleResourceBundle.getBundle(String baseName,Locale locale,ClassLoader loader) Gets a resource bundle using the specified base name, locale, and classloader.staticResourceBundleResourceBundle.getBundle(String baseName,Locale targetLocale,ClassLoader loader,ResourceBundle.Control control) Returns a resource bundle using the specified base name, targetlocale, class loader and control.static <S> ServiceLoader<S> ServiceLoader.load(Class<S> service,ClassLoader loader) Creates a new service loader for the given service.booleanResourceBundle.Control.needsReload(String baseName,Locale locale,String format,ClassLoader loader,ResourceBundle bundle, long loadTime) Determines if the expiredbundlein the cache needsto be reloaded based on the loading time given byloadTimeor some other criteria.ResourceBundle.Control.newBundle(String baseName,Locale locale,String format,ClassLoader loader, boolean reload) Instantiates a resource bundle for the given bundle name of thegiven format and locale, using the given class loader ifnecessary.Uses ofClassLoader injavax.imageio.spi
Methods injavax.imageio.spi with parameters of typeClassLoaderModifier and TypeMethodDescriptionstatic <T> Iterator<T> ServiceRegistry.lookupProviders(Class<T> providerClass,ClassLoader loader) Searches for implementations of a particular service classusing the given class loader.Uses ofClassLoader injavax.management
Methods injavax.management that returnClassLoaderModifier and TypeMethodDescriptionMBeanServer.getClassLoader(ObjectName loaderName) Return the namedClassLoader.MBeanServer.getClassLoaderFor(ObjectName mbeanName) Return theClassLoaderthat was used forloading the class of the named MBean.Methods injavax.management with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticClass<?> DefaultLoaderRepository.loadClassWithout(ClassLoader loader,String className) Deprecated.Go through the list of class loaders but exclude the given class loader, then try to loadthe requested class.Uses ofClassLoader injavax.management.loading
Methods injavax.management.loading with parameters of typeClassLoaderModifier and TypeMethodDescriptionClass<?> ClassLoaderRepository.loadClassBefore(ClassLoader stop,String className) Load the given class name through the list of class loaders,stopping at the given one.Class<?> ClassLoaderRepository.loadClassWithout(ClassLoader exclude,String className) Load the given class name through the list of class loaders,excluding the given one.staticClass<?> DefaultLoaderRepository.loadClassWithout(ClassLoader loader,String className) Deprecated.Go through the list of class loaders but exclude the givenclass loader, then try to loadthe requested class.Uses ofClassLoader injavax.management.remote.rmi
Methods injavax.management.remote.rmi that returnClassLoaderModifier and TypeMethodDescriptionRMIServerImpl.getDefaultClassLoader()Gets the defaultClassLoaderused by this connectorserver.Methods injavax.management.remote.rmi with parameters of typeClassLoaderModifier and TypeMethodDescriptionvoidRMIServerImpl.setDefaultClassLoader(ClassLoader cl) Sets the defaultClassLoaderfor this connectorserver.Constructors injavax.management.remote.rmi with parameters of typeClassLoaderModifierConstructorDescriptionRMIConnectionImpl(RMIServerImpl rmiServer,String connectionId,ClassLoader defaultClassLoader,Subject subject,Map<String, ?> env) Constructs a newRMIConnection.Uses ofClassLoader injavax.script
Constructors injavax.script with parameters of typeClassLoaderModifierConstructorDescriptionScriptEngineManager(ClassLoader loader) This constructor loads the implementations ofScriptEngineFactoryvisible to the givenClassLoaderusing the service provider mechanism.
If loader isnull, the script engine factories that arebundled with the platform are loaded.Uses ofClassLoader injavax.sql.rowset
Methods injavax.sql.rowset with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticRowSetFactoryRowSetProvider.newFactory(String factoryClassName,ClassLoader cl) Creates a new instance of aRowSetFactoryfrom thespecified factory class name.Uses ofClassLoader injavax.swing
Methods injavax.swing with parameters of typeClassLoaderModifier and TypeMethodDescriptionClass<? extendsComponentUI> UIDefaults.getUIClass(String uiClassID,ClassLoader uiClassLoader) The value ofget(uidClassID)must be theStringname of aclass that implements the correspondingComponentUIclass.static voidJEditorPane.registerEditorKitForContentType(String type,String classname,ClassLoader loader) Establishes the default bindings oftypetoclassname.Uses ofClassLoader injavax.tools
Methods injavax.tools that returnClassLoaderModifier and TypeMethodDescriptionForwardingJavaFileManager.getClassLoader(JavaFileManager.Location location) JavaFileManager.getClassLoader(JavaFileManager.Location location) Returns a class loader for loading plug-ins from the givenpackage-oriented location.staticClassLoaderToolProvider.getSystemToolClassLoader()Deprecated.This method is subject to removal in a future version ofJava SE.Uses ofClassLoader injavax.xml.datatype
Methods injavax.xml.datatype with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticDatatypeFactoryDatatypeFactory.newInstance(String factoryClassName,ClassLoader classLoader) Obtain a new instance of aDatatypeFactoryfrom class name.Uses ofClassLoader injavax.xml.parsers
Methods injavax.xml.parsers with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticDocumentBuilderFactoryDocumentBuilderFactory.newInstance(String factoryClassName,ClassLoader classLoader) Obtain a new instance of aDocumentBuilderFactoryfrom class name.staticSAXParserFactorySAXParserFactory.newInstance(String factoryClassName,ClassLoader classLoader) Obtain a new instance of aSAXParserFactoryfrom class name.staticDocumentBuilderFactoryDocumentBuilderFactory.newNSInstance(String factoryClassName,ClassLoader classLoader) Creates a new NamespaceAware instance of aDocumentBuilderFactoryfrom the class name.staticSAXParserFactorySAXParserFactory.newNSInstance(String factoryClassName,ClassLoader classLoader) Creates a new NamespaceAware instance of aSAXParserFactoryfromthe class name.Uses ofClassLoader injavax.xml.stream
Methods injavax.xml.stream with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticXMLEventFactoryXMLEventFactory.newFactory(String factoryId,ClassLoader classLoader) Create a new instance of the factory.staticXMLInputFactoryXMLInputFactory.newFactory(String factoryId,ClassLoader classLoader) Create a new instance of the factory.staticXMLOutputFactoryXMLOutputFactory.newFactory(String factoryId,ClassLoader classLoader) Create a new instance of the factory.staticXMLEventFactoryXMLEventFactory.newInstance(String factoryId,ClassLoader classLoader) Deprecated.This method has been deprecated to maintain API consistency.staticXMLInputFactoryXMLInputFactory.newInstance(String factoryId,ClassLoader classLoader) Deprecated.This method has been deprecated to maintain API consistency.staticXMLInputFactoryXMLOutputFactory.newInstance(String factoryId,ClassLoader classLoader) Deprecated.This method has been deprecated because it returns an instance of XMLInputFactory, which is of the wrong class.Uses ofClassLoader injavax.xml.transform
Methods injavax.xml.transform with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticTransformerFactoryTransformerFactory.newInstance(String factoryClassName,ClassLoader classLoader) Obtain a new instance of aTransformerFactoryfrom factory class name.Uses ofClassLoader injavax.xml.validation
Methods injavax.xml.validation with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticSchemaFactorySchemaFactory.newInstance(String schemaLanguage,String factoryClassName,ClassLoader classLoader) Obtain a new instance of aSchemaFactoryfrom class name.Uses ofClassLoader injavax.xml.xpath
Methods injavax.xml.xpath with parameters of typeClassLoaderModifier and TypeMethodDescriptionstaticXPathFactoryXPathFactory.newInstance(String uri,String factoryClassName,ClassLoader classLoader) Obtain a new instance of aXPathFactoryfrom a factory class name.Uses ofClassLoader injdk.dynalink
Methods injdk.dynalink with parameters of typeClassLoaderModifier and TypeMethodDescriptionvoidDynamicLinkerFactory.setClassLoader(ClassLoader classLoader) Sets the class loader for automatic discovery of available guardingdynamic linkers.Uses ofClassLoader injdk.jshell.execution
Constructors injdk.jshell.execution with parameters of typeClassLoaderModifierConstructorDescriptionLocalExecutionControl(ClassLoader parent) Create an instance using the default class loading, but delegating to the specified parent class loader.