Class PythonHostMembers

java.lang.Object
io.micronaut.context.python.PythonHostMembers

@Internal public final class PythonHostMembers extends Object
Members of Java objects that GraalPy host interop does not expose: the public methods a public class inherits from a non-public superclass.

GraalPy only exposes a method whose declaring class is public, so the methods PullSubscribeOptions.Builder inherits from the protected generic SubscribeOptions.Builder are invisible (foreign object has no attribute 'stream') although Java code calls them through the public subclass. The Python class registered for java.lang.Object in GraalPyContextFactory asks inheritedMember(Object, String) for such a name after the regular lookup failed; the method is then invoked through a method handle looked up on the public subclass, which is how compiled Java code reaches it.

Since:
5.2.0
Author:
Micronaut Team
  • Method Details

    • inheritedMember

      public static @Nullable Object inheritedMember(Object receiver, String name)
      A callable invoking the public methods of the given name that the class of the receiver inherits from a non-public superclass, or null when it has none.
      Parameters:
      receiver - The Java object
      name - The member name
      Returns:
      The callable, or null