Interface NativeContext


  • public interface NativeContext
    Services exposed to native-method handlers: heap access, class resolution, and guest string and exception construction.
    • Method Detail

      • getHeapManager

        HeapManager getHeapManager()
        Returns:
        the heap backing allocation, interning, and static-field access
      • getClassResolver

        ClassResolver getClassResolver()
        Returns:
        the resolver used for class and member lookup
      • createString

        ObjectInstance createString​(String value)
        Interns a host string as a guest string instance.
        Parameters:
        value - the host string
        Returns:
        the guest string
      • createException

        ObjectInstance createException​(String className,
                                       String message)
        Allocates a guest exception with its detail message field populated.
        Parameters:
        className - the internal name of the exception class
        message - the detail message, may be null to leave it unset
        Returns:
        the guest exception instance