Class DndGroovyClassLoader

java.lang.Object
java.lang.ClassLoader
io.deephaven.enterprise.dnd.classloader.DndGroovyClassLoader
Direct Known Subclasses:
ControllerClientClassLoader

@InternalUseOnly @NotThreadSafe public abstract class DndGroovyClassLoader extends ClassLoader
Despite class name, this class doesn't extend the Groovy class loader, but rather handles getting Groovy script resources. Subclasses will vary in how scripts are retrieved and stored locally.
  • Method Details

    • setDndClassLoader

      public static ControllerClientClassLoader setDndClassLoader(@NotNull @NotNull File cacheDir, @NotNull @NotNull Database database, @Nullable @Nullable String scriptLoaderStateJson, @NotNull @NotNull ControllerClientFactory controllerClientFactory)
      Set custom DnD class loader to retrieve Groovy scripts on imports over the network from DHE workspace data and controller script loader.

      Class loader should be set before creating the DHC Groovy session so that its class loaders are children to this one.

      Parameters:
      cacheDir - where retrieved remote Groovy scripts will be cached
      database - required to get notebooks
      scriptLoaderStateJson - required for consistent script state if e.g. PQ context
      controllerClientFactory - the ControllerClientFactory to use
      Returns:
      controller client class loader intended for script session to invalidate cache on new commands; note that this is not the class loader installed to the current thread
    • getResource

      @Nullable public @Nullable URL getResource(String name)
      Overrides:
      getResource in class ClassLoader