Class ClassInjector.UsingJna.Dispatcher.Enabled

    • Constructor Detail

      • Enabled

        protected Enabled​(ClassInjector.UsingJna.Dispatcher.Jvm jvm)
        Creates a new dispatcher for a JNI's class definition utilities.
        Parameters:
        jvm - The JNA-dispatcher to use for invoking JNI's class definition utilities.
    • Method Detail

      • isAvailable

        public boolean isAvailable()
        Checks if this dispatcher is available for use.
        Specified by:
        isAvailable in interface ClassInjector.UsingJna.Dispatcher
        Returns:
        true if this dispatcher is available for use.
      • defineClass

        public java.lang.Class<?> defineClass​(java.lang.ClassLoader classLoader,
                                              java.lang.String name,
                                              byte[] binaryRepresentation,
                                              java.security.ProtectionDomain protectionDomain)
        Defines a class.
        Specified by:
        defineClass in interface ClassInjector.UsingJna.Dispatcher
        Parameters:
        classLoader - The class loader or null if 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 or null if no protection domain should be used.
        Returns:
        The class that was defined.