Package ej.wasi

Interface WasiIORegistry

  • All Known Subinterfaces:
    WasiSSLRegistry

    public interface WasiIORegistry
    Provides file-descriptor registration and resolution for a WASI context.

    Implemented by WasiContext (package-private) and passed to components outside the ej.wasi package that need to register a newly-opened I/O object or resolve a file descriptor to its backing I/O object (e.g. WasiDirImpl, Selector, WasiSSL).

    • Method Detail

      • registerIO

        int registerIO​(WasiIO wio)
        Registers the given WasiIO under a new file descriptor.
        Parameters:
        wio - the I/O to register.
        Returns:
        the new file descriptor.
      • getIO

        @Nullable
        WasiIO getIO​(int fd)
        Returns the WasiIO registered under the given file descriptor, or null if no I/O is registered there.
        Parameters:
        fd - the file descriptor to look up.
        Returns:
        the associated WasiIO, or null.