Class VirtualMachine

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public final class VirtualMachine extends GObject

JSCVirtualMachine represents a group of JSCContexts. It allows concurrent JavaScript execution by creating a different instance of JSCVirtualMachine in each thread.

To create a group of JSCContexts pass the same JSCVirtualMachine instance to every JSCContext constructor.

  • Constructor Details

    • VirtualMachine

      public VirtualMachine(MemorySegment address)
      Create a VirtualMachine instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • VirtualMachine

      public VirtualMachine()
      Create a new VirtualMachine.
  • Method Details

    • getType

      public static @Nullable Type getType()
      Get the GType of the VirtualMachine class.
      Returns:
      the GType
    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • asParent

      protected VirtualMachine asParent()
      Return this instance as if it were its parent type. Comparable to the Java super keyword, but ensures the parent typeclass is also used in native code.
      Overrides:
      asParent in class GObject
      Returns:
      the instance as if it were its parent type
    • builder

      public static VirtualMachine.Builder<? extends VirtualMachine.Builder> builder()
      A VirtualMachine.Builder object constructs a VirtualMachine with the specified properties. Use the various set...() methods to set properties, and finish construction with VirtualMachine.Builder.build().
      Returns:
      the builder object