Interface ClassInjector.UsingJna.Dispatcher
- All Known Implementing Classes:
ClassInjector.UsingJna.Dispatcher.Enabled, ClassInjector.UsingJna.Dispatcher.Unavailable
- Enclosing class:
ClassInjector.UsingJna
protected static interface ClassInjector.UsingJna.Dispatcher
A dispatcher for JNA class injection.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumAn action for creating a JNA dispatcher.static classAn enabled dispatcher for JNA-based class injection.static interfaceA JNA dispatcher for the JVM's JVM_DefineClass method.static classAn unavailable dispatcher for JNA-based class injection.static enumA mapper for 32-bit Windows functions where names are defined with different convention. -
Method Summary
Modifier and TypeMethodDescriptionClass<?> defineClass(ClassLoader classLoader, String name, byte[] binaryRepresentation, ProtectionDomain protectionDomain) Defines a class.booleanChecks if this dispatcher is available for use.
-
Method Details
-
isAvailable
boolean isAvailable()Checks if this dispatcher is available for use.- Returns:
trueif this dispatcher is available for use.
-
defineClass
Class<?> defineClass(@MaybeNull ClassLoader classLoader, String name, byte[] binaryRepresentation, @MaybeNull ProtectionDomain protectionDomain) Defines a class.- Parameters:
classLoader- The class loader ornullif a class should be injected into the bootstrap loader.name- The class's name.binaryRepresentation- The class's class file.protectionDomain- The protection domain to use ornullif no protection domain should be used.- Returns:
- The class that was defined.
-