Package jline.api.sym
Class SymEngines
java.lang.Object
jline.api.sym.SymEngines
Resolves the symbolic backend to use, and owns the container that serves it.
Resolution order, the same in MATLAB (SAGE.m) and Python (line_solver.api.sym):
- an explicit URL, from solver options or the
requestedargument; - the
LINE_SAGE_URLenvironment variable; - a line-sage-rest service already listening on a conventional port;
- a container started here from a locally present image;
- nothing, in which case the caller falls back to whatever native algebra it has, or reports that no backend is configured.
Step 3 verifies identity through /api/v1/info rather than trusting
the port: every imperialqore line-*-rest service listens on 8080 by
convention, so a health probe alone would happily accept the LQNS service.
The container started in step 4 is reused for the life of the JVM and stopped by a shutdown hook. It is bound to an ephemeral host port, so several JVMs, or a JVM alongside a hand-started service, do not collide.
Copyright (c) 2012-2026, Imperial College London All rights reserved.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringImage serving the symbolic REST API.static final String[]Fallback tags, tried in order afterDOCKER_IMAGE.static final int[]Ports probed for an already running service, in order.static final intSeconds to wait for a container to report healthy.static final StringEnvironment variable naming a service to use. -
Method Summary
-
Field Details
-
DOCKER_IMAGE
Image serving the symbolic REST API.- See Also:
-
DOCKER_IMAGE_CANDIDATES
Fallback tags, tried in order afterDOCKER_IMAGE. -
URL_ENV
Environment variable naming a service to use.- See Also:
-
PROBE_PORTS
public static final int[] PROBE_PORTSPorts probed for an already running service, in order. -
STARTUP_TIMEOUT_SECONDS
public static final int STARTUP_TIMEOUT_SECONDSSeconds to wait for a container to report healthy.- See Also:
-
-
Method Details
-
resolve
Resolves an engine with the default request, i.e. "auto".- Returns:
- an engine, or null if no backend could be resolved
-
resolve
Resolves an engine.- Parameters:
requested- "" or "auto" to search, a URL to use a specific service, "none" to disable the backend, or an image name to start- Returns:
- an engine, or null if no backend could be resolved
-
findImage
- Returns:
- the first locally present image tag, or null if none is
-
stopContainer
public static void stopContainer()Stops the container started by this JVM, if any.
-