Class CallSiteClassLoader


public class CallSiteClassLoader extends ClassLoaderForClassArtifacts
Class loader used when generating specialized classic call-site classes.

Prefer invokedynamic call sites for new code. Planned for deprecation/removal in a future Groovy version.

  • Constructor Details

    • CallSiteClassLoader

      public CallSiteClassLoader(Class klazz)
      Creates a loader for artifacts of klazz, using that class's loader as the parent.
      Parameters:
      klazz - the class whose loader, name, and protection domain are captured
  • Method Details

    • loadClass

      protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException
      Loads a known call-site or meta-class type from this class's defining loader. Any other name is delegated to the superclass, and a ClassNotFoundException from that delegation is retried on this class's defining loader.
      Overrides:
      loadClass in class ClassLoader
      Parameters:
      name - the binary name to load
      resolve - whether the class is linked after it is loaded
      Returns:
      the loaded class
      Throws:
      ClassNotFoundException - when neither loader can find name