Interface Container

All Superinterfaces:
org.teavm.jso.JSObject

public interface Container extends org.teavm.jso.JSObject
A Containers binding. Declared with container(), named CONTAINER by default.

Reached through a Durable Object, so an instance is addressed by id the same way and the container's lifetime follows that instance.

Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    doSignal(int signal)
     
    org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject>
    doStart(TSObject options)
     
    getTcpPort(int port)
    Opens a TCP connection to a port inside the container.
    boolean
    Returns whether the container is running.
    default void
    signal(int signal)
    Signals the container.
    default void
    Starts the container.
    default void
    start(TSObject options)
    Starts the container with entrypoint overrides.
    default void
    Stops the container gracefully.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • isRunning

      boolean isRunning()
      Returns whether the container is running.
      Returns:
      whether the container is running
    • start

      default void start()
      Starts the container.
    • start

      default void start(TSObject options)
      Starts the container with entrypoint overrides.
      Parameters:
      options - entrypoint, env, enableInternet
    • signal

      default void signal(int signal)
      Signals the container.
      Parameters:
      signal - the signal number, 15 for a graceful stop
    • stop

      default void stop()
      Stops the container gracefully.
    • getTcpPort

      TSObject getTcpPort(int port)
      Opens a TCP connection to a port inside the container.
      Parameters:
      port - the port
      Returns:
      the socket
    • doStart

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> doStart(TSObject options)
    • doSignal

      org.teavm.jso.core.JSPromise<org.teavm.jso.JSObject> doSignal(int signal)