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
Modifier and TypeMethodDescriptionClass<?> JVM_DefineClass(com.sun.jna.JNIEnv env, String name, ClassLoader classLoader, byte[] binaryRepresentation, int length, ProtectionDomain protectionDomain) Defines a new class into a given class loader.
-
Method Details
-
JVM_DefineClass
Class<?> JVM_DefineClass(com.sun.jna.JNIEnv env, String name, @MaybeNull ClassLoader classLoader, byte[] binaryRepresentation, int length, @MaybeNull 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 ornullif injecting into the bootstrap loader.binaryRepresentation- The class's binary representation.length- The length of the class's binary representation.protectionDomain- The protection domain ornullif no explicit protection domain should be used.- Returns:
- The class that was defined.
- Throws:
com.sun.jna.LastErrorException- If an error occurs during injection.
-