Interface ClassInjector.UsingInstrumentation.Dispatcher

  • Enclosing class:
    ClassInjector.UsingInstrumentation

    @Proxied("java.lang.instrument.Instrumentation")
    protected static interface ClassInjector.UsingInstrumentation.Dispatcher
    A dispatcher to interact with the instrumentation API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void appendToBootstrapClassLoaderSearch​(java.lang.instrument.Instrumentation instrumentation, java.util.jar.JarFile jarFile)
      Appends a jar file to the bootstrap class loader.
      void appendToSystemClassLoaderSearch​(java.lang.instrument.Instrumentation instrumentation, java.util.jar.JarFile jarFile)
      Appends a jar file to the system class loader.
      boolean isModifiableModule​(java.lang.instrument.Instrumentation instrumentation, java.lang.Object module)
      Checks if a module is modifiable.
      void redefineModule​(java.lang.instrument.Instrumentation instrumentation, java.lang.Object module, java.util.Set<?> reads, java.util.Map<java.lang.String,​java.util.Set<?>> exports, java.util.Map<java.lang.String,​java.util.Set<?>> opens, java.util.Set<java.lang.Class<?>> uses, java.util.Map<java.lang.Class<?>,​java.util.List<java.lang.Class<?>>> provides)
      Redefines an existing module.
    • Method Detail

      • appendToBootstrapClassLoaderSearch

        void appendToBootstrapClassLoaderSearch​(java.lang.instrument.Instrumentation instrumentation,
                                                java.util.jar.JarFile jarFile)
        Appends a jar file to the bootstrap class loader.
        Parameters:
        instrumentation - The instrumentation instance to interact with.
        jarFile - The jar file to append.
      • appendToSystemClassLoaderSearch

        void appendToSystemClassLoaderSearch​(java.lang.instrument.Instrumentation instrumentation,
                                             java.util.jar.JarFile jarFile)
        Appends a jar file to the system class loader.
        Parameters:
        instrumentation - The instrumentation instance to interact with.
        jarFile - The jar file to append.
      • isModifiableModule

        boolean isModifiableModule​(java.lang.instrument.Instrumentation instrumentation,
                                   @Proxied("java.lang.Module")
                                   java.lang.Object module)
        Checks if a module is modifiable.
        Parameters:
        instrumentation - The instrumentation instance to use for checking for modifiability.
        module - The java.lang.Module to examine.
        Returns:
        true if the supplied module is modifiable.
      • redefineModule

        void redefineModule​(java.lang.instrument.Instrumentation instrumentation,
                            @Proxied("java.lang.Module")
                            java.lang.Object module,
                            java.util.Set<?> reads,
                            java.util.Map<java.lang.String,​java.util.Set<?>> exports,
                            java.util.Map<java.lang.String,​java.util.Set<?>> opens,
                            java.util.Set<java.lang.Class<?>> uses,
                            java.util.Map<java.lang.Class<?>,​java.util.List<java.lang.Class<?>>> provides)
        Redefines an existing module.
        Parameters:
        instrumentation - The instrumentation instance to redefine.
        module - The java.lang.Module to redefine.
        reads - A set of java.lang.Modules that are to be read additionally.
        exports - A map of packages to a set of java.lang.Modules to read additionally.
        opens - A map of packages to a set of java.lang.Modules to open to additionally.
        uses - A list of types to use additionally.
        provides - A list of types to their implementations to offer additionally.