JabRpaServer

Manages the lifecycle of the jab-rpa-server.exe subprocess.

Spawns the Rust gRPC server, waits for it to report readiness, and provides clean shutdown.

Requires a binary package to be installed (e.g. pip install jab-rpa[java8]).

Can be used as a context manager:

with JabRpaServer() as server:
    ...

__init__

__init__(
    *,
    java_bitness: Literal["32 bit", "64 bit"] = "32 bit",
    java_version: Literal[
        "8", "11", "17", "21", "25"
    ] = "8",
    server_address: str = "127.0.0.1",
    server_port: str = "50051",
    server_timeout: int = _WAIT_FOR_SERVER_TIMEOUT,
    step: int = _INIT_SERVER_STEP,
    print_stdout: bool = False,
    print_stderr: bool = True,
) -> None

Configure the server process settings.

Parameters:
  • java_bitness (Literal['32 bit', '64 bit'], default: '32 bit' ) –

    "32 bit" (default) or "64 bit". Controls which pre-built server binary is used.

  • java_version (Literal['8', '11', '17', '21', '25'], default: '8' ) –

    "8" (default), "11", "17", "21", or "25". Java version the target application runs on. Only Java 8 has been proven to work reliably in production.

  • server_address (str, default: '127.0.0.1' ) –

    Server bind address (default "127.0.0.1").

  • server_port (str, default: '50051' ) –

    Server bind port (default "50051").

  • server_timeout (int, default: _WAIT_FOR_SERVER_TIMEOUT ) –

    Maximum seconds to wait for the server to start.

  • step (int, default: _INIT_SERVER_STEP ) –

    Seconds between readiness checks.

  • print_stdout (bool, default: False ) –

    If True, forward server stdout to the console.

  • print_stderr (bool, default: True ) –

    If True (default), forward server stderr to the console.

start

start() -> None

Launch the server subprocess and wait for it to become ready.

Reads stdout in a background daemon thread and watches for the server's "listening" message.

Raises:
  • ServerStoppedError –

    If the process exits before reporting readiness.

  • TimeoutError –

    If the server does not become ready within the timeout.

stop

stop() -> None

Terminate the server subprocess.

Bases: Exception

Raised when the JAB gRPC server process exits before it starts listening.