Interface ClassInjector.UsingJna.Dispatcher.Jvm

  • All Superinterfaces:
    com.sun.jna.Library
    Enclosing interface:
    ClassInjector.UsingJna.Dispatcher

    public static interface ClassInjector.UsingJna.Dispatcher.Jvm
    extends com.sun.jna.Library
    A JNA dispatcher for the JVM's JVM_DefineClass method.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface com.sun.jna.Library

        com.sun.jna.Library.Handler
    • Field Summary

      • Fields inherited from interface com.sun.jna.Library

        OPTION_ALLOW_OBJECTS, OPTION_CALLING_CONVENTION, OPTION_CLASSLOADER, OPTION_FUNCTION_MAPPER, OPTION_INVOCATION_MAPPER, OPTION_OPEN_FLAGS, OPTION_STRING_ENCODING, OPTION_STRUCTURE_ALIGNMENT, OPTION_SYMBOL_PROVIDER, OPTION_TYPE_MAPPER
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Class<?> JVM_DefineClass​(com.sun.jna.JNIEnv env, java.lang.String name, java.lang.ClassLoader classLoader, byte[] binaryRepresentation, int length, java.security.ProtectionDomain protectionDomain)
      Defines a new class into a given class loader.
    • Method Detail

      • JVM_DefineClass

        java.lang.Class<?> JVM_DefineClass​(com.sun.jna.JNIEnv env,
                                           java.lang.String name,
                                           @MaybeNull
                                           java.lang.ClassLoader classLoader,
                                           byte[] binaryRepresentation,
                                           int length,
                                           @MaybeNull
                                           java.security.ProtectionDomain protectionDomain)
                                    throws com.sun.jna.LastErrorException
        Defines a new class into a given class loader.
        Parameters:
        env - The JNI environment.
        name - The internal name of the class.
        classLoader - The class loader to inject into or null if injecting into the bootstrap loader.
        binaryRepresentation - The class's binary representation.
        length - The length of the class's binary representation.
        protectionDomain - The protection domain or null if no explicit protection domain should be used.
        Returns:
        The class that was defined.
        Throws:
        com.sun.jna.LastErrorException - If an error occurs during injection.