public final class HyperProcess
extends java.lang.Object
implements java.lang.AutoCloseable
This is an AutoCloseable
class since it maintains native resources. The Hyper process must always
be closed when it is no longer needed. The best way to guarantee this is to use a try-with-resources block.
Constructor and Description |
---|
HyperProcess(java.nio.file.Path hyperPath,
Telemetry telemetry)
Starts a new Hyper process using the given path to the Hyper executable.
|
HyperProcess(java.nio.file.Path hyperPath,
Telemetry telemetry,
java.lang.String userAgent)
Starts a new Hyper process using the given path to the Hyper executable.
|
HyperProcess(java.nio.file.Path hyperPath,
Telemetry telemetry,
java.lang.String userAgent,
java.util.Map<java.lang.String,java.lang.String> parameters)
Starts a new Hyper process using the given path to the Hyper executable.
|
HyperProcess(Telemetry telemetry)
Starts a new Hyper process trying to automatically locate the Hyper binary.
|
HyperProcess(Telemetry telemetry,
java.lang.String userAgent)
Starts a new Hyper process trying to automatically locate the Hyper binary.
|
HyperProcess(Telemetry telemetry,
java.lang.String userAgent,
java.util.Map<java.lang.String,java.lang.String> parameters)
Starts a new Hyper process trying to automatically locate the Hyper binary.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this Hyper process object, relinquishing the underlying native handle.
|
Endpoint |
getEndpoint()
Returns the endpoint descriptor of the Hyper process.
|
boolean |
isOpen()
Returns whether the Hyper process is open.
|
void |
shutdown()
Shuts down the Hyper process and waits for it to exit.
|
void |
shutdown(int timeoutMs)
Shuts down the Hyper process.
|
public HyperProcess(java.nio.file.Path hyperPath, Telemetry telemetry, java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> parameters)
hyperPath
- The file path to the Hyper executable.telemetry
- Whether to send telemetry to Tableau.userAgent
- A user agent string, which will be used in telemetry and logging/parameters
- Optional parameters for starting the Hyper process. The available parameters are documented
in the Tableau Hyper documentation, chapter "Process Settings".HyperException
- Thrown when starting the Hyper process fails.public HyperProcess(java.nio.file.Path hyperPath, Telemetry telemetry, java.lang.String userAgent)
hyperPath
- The file path to the Hyper executable.telemetry
- Whether to send telemetry to Tableau.userAgent
- A user agent string, which will be used in telemetry and logging/HyperException
- Thrown when starting the Hyper process fails.public HyperProcess(Telemetry telemetry, java.lang.String userAgent, java.util.Map<java.lang.String,java.lang.String> parameters)
Tries to locate the Hyper binaries by locating the JAR file. The JAR file is assumed to reside in a libraries directory that contains the Hyper binaries in a "hyper" subfolder.
telemetry
- Whether to send telemetry to Tableau.userAgent
- A user agent string, which will be used in telemetry and logging.parameters
- Optional parameters for starting the Hyper process. The available parameters are documented
in the Tableau Hyper documentation, chapter "Process Settings".HyperException
- Thrown when starting the Hyper process fails.public HyperProcess(Telemetry telemetry, java.lang.String userAgent)
Tries to locate the Hyper binaries by locating the JAR file. The JAR file is assumed to reside in a libraries directory that is on the same level as a "bin" directory that contains the Hyper binaries in a "hyper" subfolder.
telemetry
- Whether to send telemetry to Tableau.userAgent
- A user agent string, which will be used in telemetry and logging.HyperException
- Thrown when starting the Hyper process fails.public HyperProcess(java.nio.file.Path hyperPath, Telemetry telemetry)
hyperPath
- The file path to the Hyper executable.telemetry
- Whether to send telemetry to Tableau.HyperException
- Thrown when starting the Hyper process fails.public HyperProcess(Telemetry telemetry)
Tries to locate the Hyper binaries by locating the JAR file. The JAR file is assumed to reside in a libraries directory that is on the same level as a "bin" directory that contains the Hyper binaries in a "hyper" subfolder.
telemetry
- Whether to send telemetry to Tableau.HyperException
- Thrown when starting the Hyper process fails.public void shutdown(int timeoutMs)
If timeoutMs > 0ms, wait for Hyper to shut down gracefully. If the process is still running after a timeout of timeoutMs milliseconds, terminate the process forcefully and throw an exception.
If timeoutMs < 0ms, wait indefinitely for Hyper to shut down.
If timeoutMs == 0ms, immediately terminate Hyper forcefully. Does not throw if the process already exited with a non-zero exit code.
timeoutMs
- The timeout in millisecondsHyperException
- Thrown if there was an error stopping the process, if the process was forcefully killed after the timeout, or if the process already exited with a non-zero exit code.public void shutdown()
HyperException
- Thrown if there was an error stopping the process, if the process was forcefully killed after the timeout, or if the process already exited with a non-zero exit code.public Endpoint getEndpoint()
public boolean isOpen()
public void close()
close
in interface java.lang.AutoCloseable